Community Profile

# Walter Roberson

Last seen: Today Attivo dal 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. I am currently caught up to T0099119; if you are waiting on a reply from me for an older issue, please send me a reminder.

Programming Languages:
C, MATLAB, Shell, Perl, Fortran
Spoken Languages:
English

All

#### Content Feed

Visto da

Risposto
How do I fix the error of arrays having incompatible sizes?
Yes, you need to loop over KC values. Your ndt is a vector with values calculated in terms of KC. And that means that X(1:floo...

circa 18 ore fa | 0

Risposto
Your posted code has Q0 = [120;21;24;23]; which is fine. But your error message is from running some other code -- code that...

circa 18 ore fa | 0

Risposto
Error while creating fitness function
It looks to me as if you ran the function by pressing the green Run button. But possibly there is a place in SparrowSearchAlgori...

circa 18 ore fa | 0

Risposto
pass input arguments of built in function as cell array or structure?
feval('plot', S{:}) feval does not support passing in any kind of structured input . Most functions do not support providing s...

circa 18 ore fa | 0

| accettato

Risposto
Why am I getting an error here?
function I = simpson(f,a,b) depth 1 for i = 0:n depth 2 if i==0 || i==n depth 3 elseif mod(i,2)~=0 depth 3 elseif mod(i,...

circa 19 ore fa | 0

Risposto
How do I plot a prod function in MATLAB?
syms t N ht = 2 * symprod((t-5)/4, t, 1, N) T = 1:10; y = double(subs(ht, N, T)) plot(T, y)

circa 20 ore fa | 0

Risposto
i don't know code
x=[10 20 30 40 50 60 70]; That is a numeric vector. f(x)=1./(cosd(x)+2*sind(x)).^2; The right-hand side calculates a vector o...

1 giorno fa | 1

Risposto
Coloring string, fprintf seems limited and cprintf is even a thing?
cprintf is a File Exchange contribution. You can install it using the Add-On Explorer. The return value from fprintf() is the n...

1 giorno fa | 0

Risposto
Error: Array indices must be positive integers or logical values. implementing fletcher reeves method
fletcherreeves2([5;5],@(x) x(1)^2-x(1)*x(2)+4*x(2)^2+3*x(1)+2,@(x) [2*x(1)-x(2)+3,-x(1)+8*x(2)],10^-(6)) The third parameter th...

2 giorni fa | 0

Risposto
Can it be possible to use a for loop to precise the code
%%% The following lines need to be in squeezed so that it will save time (using for loop) Using a for loop is only faster th...

3 giorni fa | 0

| accettato

Risposto
Can we use standard deviation of color image as a contrast value?
That particular kind of contrast is called RMS contrast; there are other contrast measures as well. https://en.wikipedia.org/wi...

3 giorni fa | 0

Risposto
How can I calculate ln(x) in matlab code?
There seems to be some conception that "ln" is the "right" way to take natural logarithm, and that MATLAB is... deficient... bec...

3 giorni fa | 0

Risposto
houw can I get the number of terms?
First realize that the sum of 2 cube + 4 cube + 6 cube and so on, is 2 cube times (1 cube + 2 cube + 3 cube +...) Now look u...

3 giorni fa | 0

Risposto
'Unable to concatenate the table variables 'Var1' and 'Var2', because their types are cell and double.' why this error is showing?
Your file contains a mix of text and numeric. What result are you expecting when you ask to convert it to a single array?

3 giorni fa | 1

Risposto
why plot line style not change?
you are plotting only one point at a time. plot() only draws lines when there are at least two adjacent finite coordinates in a ...

4 giorni fa | 1

Risposto
Arrazy size problem at line 24
P= (-m)*(Acc); p=fft(P); m is a scalar and Acc has 6 elements so P has 6 elements. fft with one parameter returns someth...

4 giorni fa | 0

Risposto
Summing over indices using symsum
You cannot use a symbolic variable as an index. I think it is unlikely that it will ever be supported to use symbolic variable...

4 giorni fa | 1

Risposto
can we make 3D mash plot from eq y(x)
syms x theta g=9.81; v0=25; y0=1; fun = (-1)*(tand(theta)*x-(g/(2*v0^2*cosd(theta)^2)*x.^2)+y0); fsurf(fun, [0 300, 0 90]...

4 giorni fa | 0

Risposto
Pre-built functions suddenly became undefined in app designer?
if timerfind() returns empty then it is [] that it returns rather than an empty array of class timer. And stop([]) does not work...

5 giorni fa | 0

Risposto
make function to plot countour and 3D
f=@(X,Y) 2+X-Y+2*X.^2+2*X.*Y+Y.^2; plot3dfunc(f,-2,0,0,3) function plot3dfunc(f,Xmin,Xmax,Ymin,Ymax) x=linspace(Xmin,Xmax,5...

5 giorni fa | 0

| accettato

Risposto
Add an image to subplot
axis image after you display the plot. This will set the aspect ratio to square so that the image does not get streched wide.

5 giorni fa | 1

| accettato

Risposto
1*0 empty double row vector
19 < X is never true, so find() is going to return empty. What result were you hoping for in the case where the input value is ...

5 giorni fa | 0

Risposto
Help in writing a a code for an array based on comdition.
See sum sign However, your description does not match your example. You say you want to replace positive numbers with 1, but yo...

5 giorni fa | 0

Risposto
Slove function return empty solutions
Use dsolve for differential equations

5 giorni fa | 1

Risposto
For loop variable error
m_for_k = [m1 m2]; vector. K_ex(i) = m_for_k * wn(i)^2; vector times scalar gives vector. Vector cannot be stored i...

5 giorni fa | 0

| accettato

Risposto
I was plotting some data in loglog scale "Errors against step sizes" but my curve is not connected , and i can not fix it, what is the problem?
Some of your simp_err are exactly 0 but log plots cannot draw exact 0 (or negative) so the plot disconnects there. This happe...

5 giorni fa | 0

Risposto
Array not compatible error
You are using diff() thinking that you are getting derivatives. However you are taking diff() of numeric matrices and diff() of ...

5 giorni fa | 0

Risposto
Problems with Yticks, help?
Ticks are only drawn if they fit within the axes limits. The default axes limits are determined by rounding the range of data. Y...

5 giorni fa | 0

Risposto
Error using fieldnames. Invalid argument of type 'cell'. Input must be a structure or a Java or COM object.
If you look near line 240 of https://github.com/netstim/leaddbs/blob/master/ea_normalize_ants.m you will see that the code assum...

5 giorni fa | 1