Community Profile

# Walter Roberson

##### Last seen: Today
45,813 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.

View all

Contributions in
View by

Get substring from text
S = {'Hi B', 'Hi A', 'Hey guys D can''t come', 'Too Bad C', 'I Feel bad for D'}; names = {'A', 'B', 'C', 'D'}; namepattern =...

34 minutes ago | 0

How to save UIFIGURE or UITABLE as a jpg?
it seems uitable cannot (anymore) be added to a figure but must be added to uifigure That is not correct. uit = uitable(figure...

1 hour ago | 0

Some aspects of the array syntax are great, others are a bit puzzling
[1 2 [3 4] 5] is short for horzcat(1, 2, [3 4], 5) which in turn would be short for horzcat(1, 2, horzcat(3, 4), 5) and the...

8 hours ago | 0

| accepted

Encode and Decode Problem

8 hours ago | 0

| accepted

Plugging in matrix values into function handle of more than 1 variables
x=sym('x',[1 9]); x0=sym('x0',[1 9]); Yr=sym('Yr',[3 3]); Yi=sym('Yi',[3 3]); f(1,1)=x(1)+Yr(2,2)*x0(3)+Yi(1,2)*x(4)+Yr(3,3)...

8 hours ago | 0

| accepted

DataStore function returns an error
Notice from the header that this is R2018b. Notice from the output that R2018b does not have a problem with that command.

1 day ago | 0

Understanding how to use the function griddata
graph = xlsread('Path3.xlsx'); x=graph(:,1); y=graph(:,2); z=graph(:,3); [X,Y]= meshgrid(x,y); Z = griddata(x,y,z,X,Y); su...

1 day ago | 0

| accepted

instead of saving a mat file i want ro save a .txt, i want to use fopen, fclose, and fprintf
fid = fopen('OutputFile.txt', 'w'); fprintf(fid, '%d\n', 1:10); fclose(fid)

1 day ago | 1

the purpose of %f
On output, %d is intended for signed integer; %f is intended for fixed-point representation. On input formats, such as textscan...

1 day ago | 0

Picking random numbers with some predefined probability
1) I have predefined probabilities of picking random numbers which is p = [0.16 0.24 0.28 0.32] for the intervals [3.3 4.6], [4....

1 day ago | 0

| accepted

what is fileID in matlab?
Computer languages, and operating systems, need to maintain information about every file that the program is using, such as whic...

1 day ago | 0

I keep on getting this error when I try to turn my given data into a graph
In some cases, the data forms an implicit grid. For example if your longitude repeated every 5 values and your latitude had 5 c...

1 day ago | 0

How do I wait for a function to complete in some stipulated time or move on?
MATLAB has some undocumented method of restricting CPU time that it uses for MATLAB Online and for Cody. I have not been able to...

1 day ago | 1

Converting string to number with spaces
str = "111001000100 100000100000 1100100100"; cellfun(@bin2dec, regexp(str, '\s+', 'split'))

1 day ago | 0

Extraction of elements of an array inside the other array
period(t1,t2,t3) =time(p) So t1, t2, t3 are subscripts, and time(p) is either a function or array that results in either a scal...

1 day ago | 0

vpasolve won't solve function
A1 = 817.08; A2 = 1051.38; A3 = 1267.56; A4 = 1183.44; B1 = 4.402229; B2 = 4.517190; B3 = 4.617679; B4 = 4.474013; x1 = ...

1 day ago | 1

Using Symbolic Variable in ODE45 without Separate Function and other advice
dT = matlabFunction(Hr*k*Ca^2/(2*Cao*Cpa) + UAVr/(2*Cao*Cpa)*(Ta-T), 'vars', {t, T}); and [t,T] = ode45(dT,tspan,300);

1 day ago | 1

How make MATLAB waitbar message indicate the filename being processed?
persistent h if isempty(h) || ~isvalid(h) h = waitbar(0,'Please wait...'); end for step = 1:1000 thisfilename = FileNa...

1 day ago | 0

| accepted

Error using fplot: Warning: Error updating FunctionLine.
V = [30, 123, 400, 900]; nV = length(V); for K = 1 : nV subplot(1,nV,K) fplot(@(ay) -maxax(ay, sqrt(V(K)*ay)), [0 5]...

1 day ago | 0

Is it possible Matlab shows the grid on the surface of the plot?
X=-10:.1:10; T=-10:.1:10; %i=1; w0=1; c=-1; mu1=.4*1i; a=2*mu1.^2-(2*w0.^2); [x,t]=meshgrid(X,T); u=2*(1i*mu1.*x-(1i*mu1...

2 days ago | 0

Behavior of callback function?
'Callback','pressed=1' Callbacks specified as character vectors are evalin('base') and so only affect the base workspace, not l...

2 days ago | 1

Find a variable as function of other variable with equations system using Symbolic ToolBox
syms a b c d; r = b+d; e = sym(pi)/10; %not pi/2, that does not have a solution! eq1 = c - a*sin(d) + b*cos(d) == 0; ...

2 days ago | 0

| accepted

How to improve accuracy in fsolve?
fsolve cannot limit the range of values. fzero can limit the range of variables but only for a single function in one variabl...

3 days ago | 0

| accepted

3 days ago | 0

string to argument in legend
for i=0:Nint legI(i+1) = "$${\mathcal X}_" + Nint-i + "$$"; end legend(legI)

3 days ago | 1

How can I input "function Txy (Z1,Z2,P)" properly?
You have to store the code in a file named Txy.m

3 days ago | 0

Need to solve the roots from a large equation
You will not be able to do that. If you normalize into numerator / denominator form, then you can extract the numerator, becaus...

3 days ago | 0

Shortcut to making an array
The shortcut is to not create those as separate variables the first time around. http://www.mathworks.com/matlabcentral/answers...

3 days ago | 0