Community Profile

photo

Walter Roberson


Last seen: Today
48 653 total contributions since 2011

I do not do free private consulting. If you want to bring my attention to something, send a link to the MATLAB Answers location.

Contact

Walter Roberson's Badges

  • Roberson Cup
  • Most Accepted 2019
  • Most Accepted 2018
  • Solver
  • First Review
  • Most Accepted 2017
  • 36 Month Streak
  • Most Accepted 2016
  • Most Accepted 2015
  • Most Accepted 2011
  • Most Accepted 2012
  • Most Accepted 2013
  • Thankful Level 4
  • Grand Master
  • Revival Level 4

View all

Contributions in
View by

Answered
Error using optimset(@lsqnonlin) matlab 2020b
Wrong options routine for that function. You need https://www.mathworks.com/help/optim/ug/optim.problemdef.optimizationproblem...

25 minuter ago | 0

Answered
Meaning of "#X" in output of dsolve
I have not seen that output from dsolve() before, but I confirm that it exists. If you focus in, you will see that you have sub...

ungefär 2 timmar ago | 0

Answered
Solve equation in interval
syms x solve([diff(x^2*exp(-x)), x <= 1, x >= -1])

ungefär 3 timmar ago | 0

Answered
Storing data in matlab matrix using loop
[K1, K2, K3] = ndgrid(2:1:20, 2:1:20, 2:1:20); M = K1 + K2 + K3; mask = M == 20; A = [K1(mask), K2(mask), K3(mask)]; size(A)...

ungefär 3 timmar ago | 0

Answered
Not enough input arguments
You have not shown us the definition of f, g, or j, so we cannot say which of them needs more than the four input arguments you ...

ungefär 3 timmar ago | 0

Answered
Could someone explain what the code means?
1/1^4 + 1/2^4 + 1/3^4 + 1/4^4 + 1/5^4 + 1/6^4 and keep going adding values until the number stops changing (which will happen be...

ungefär 5 timmar ago | 0

Answered
How to replace all newline characters in a string with a space?
strfind(strtxt, 10) will return the indices. Hint: S = "hello" S{1}(1) = 'j'

ungefär 5 timmar ago | 0

Answered
MATLAB DOES NOT CALCULATE THE ABSOLUTE VALUE
To get anywhere useful in a few lines, we have to make the unjustified assumption that the variable i corresponds to sqrt(-1) ...

ungefär 5 timmar ago | 0

Answered
Index exceeds the number of array elements error
Suppose MaxPayload was 250, 0:100:250 is 0 100 200. All of the entries of that are less than MaxPayload so the loop would not te...

ungefär 8 timmar ago | 0

Answered
how to use if comparison
The code is working properly according to the requirements that you stated. You want it to change the value to 0 if the conditio...

ungefär 10 timmar ago | 0

Answered
Checking if a value is equal to zero or no ? with the problem of floating-point numbers !
sum(A) - 1 ans = -1.11022302462516e-16 MATLAB uses ieee 754 binary double precision representation, which is ...

ungefär 10 timmar ago | 0

Answered
plot filled rectangle and appear on legend
Use fill() such as fill([xmin xmax xmax xmin], [ymin ymin ymax ymax], 'facecolor', 'y')

ungefär 16 timmar ago | 0

| accepted

Answered
What is the difference between Double 1.0000 and Double 1 ?
A=1; B=1.000; if (A==B) "True" else "false" end When you see something displaying as 1 with no decimal points, then...

ungefär 16 timmar ago | 0

Answered
Matrix element changes according to reference
Y=[ 11 12 13; 21 22 23; 31 32 33]; A=[1 1; 2 3; 3 2]; Y(A(:,2), A(:,2))

ungefär 16 timmar ago | 0

Answered
how to use "getframe" commander for making animation video.
Each time the XLim or YLim changes, MATLAB recalculates the exact size of the inner window. Sometimes, possibly due to round-off...

ungefär 17 timmar ago | 0

Answered
fmincon and fmiunc gives different result for the same problem
This is expected. fmincon() and fminunc() use different algorithms. You might possibly be able to get somewhere by forcing fmin...

ungefär 23 timmar ago | 0

| accepted

Answered
Cant convert more than 80 columns of data to categorical
When you categorical() numeric values, then internally it uses %-0.5g format to convert the values to character vectors. It then...

ungefär 23 timmar ago | 0

| accepted

Answered
How to extract audio from mp4 video file with Matlab?
https://www.mathworks.com/help/vision/ref/vision.videofilereader-system-object.html or use audioread without 'native' https:/...

ungefär 23 timmar ago | 0

Answered
For loop inside for loop
The first group of values goes into columns 1 to 8. Call that group number 1, and associated indices 1 to 8. The second group o...

ungefär 23 timmar ago | 1

Answered
MATLAB code for ORPD by genetic algorithm
Modify https://www.mathworks.com/matlabcentral/fileexchange/41265-optimal-reactive-power-dispatch-orpd-using-particle-swarm-opti...

ungefär 24 timmar ago | 0

Answered
wrong dimensions on a 3D array
%the below needs R2020b or later re_arranged = permute(Matrix, [2 3 1]); filtered = pagetimes(re_arranged, filter_matrix); Th...

ungefär 24 timmar ago | 0

Answered
changing the name of the csv files but getting errors
folder = fullfile('C:','Users','muhammad','Desktop','Velocity'); files = dir( fullfile(folder, '*.csv') ); % Loop through each...

ungefär 24 timmar ago | 1

| accepted

Answered
error using plot, vectors must be the same length
FV = fft(fv); %Fourier Transform of filtered signal That's a vector. FVabs = (0:abs(FV)/2); That is using t...

ungefär 24 timmar ago | 0

| accepted

Answered
Complex Numbers in Matrices
format short %create some data that has the required characteristics N = complex(rand(4,60), rand(4,60)); for K = 1 : 60; c =...

en dag ago | 0

Answered
Help With Conditonally variant Anonymous function.
B_2 = @(z) ((z>=z(501)&z<=z(1500)) * 2 - 1) .* val The logical test that is satisfied by the range will return true (1) in the ...

en dag ago | 0

Answered
Saving categorical using For loop
PosData = FilledTtrnPos(:,2:171); for i = 170 : -1 : 1 clsTraits(:,i) = categorical(PosData{:,i}); end Note that I did n...

en dag ago | 0

Answered
How do you add up data in a for loop to plot in a histogram?
sum_zm = sum(cat(3, zfm{:}),3); surf(Zf_vals, Df_vals, sum_zm, 'edgecolor', 'none'); This is not the best way: the best way is...

en dag ago | 0

Answered
Subtracting mean from table column and creating new Column with solution
t.NewColumn = mean(t{:,10}) - t{:,5};

en dag ago | 0

Answered
How to define the variables of a function handle before the function
B=0.02818; L=0.00098; h=1; t_max=5; t_span = (0:h:t_max); S_0=2782000 I_0=1; R_0=0; y0 = [S_0;I_0;R_0]; N = S_0+I_0+R...

en dag ago | 0

Answered
How do I name figures in for loops.
for i = 1 : 2 fig(i) = figure('name', sprintf('location %d', i)); end fig(1).Name fig(2).Name

en dag ago | 1

Load more