MATLAB Answers

0

how do I make an array where the value increases by a factor of 10?

Asked by Edward Rosa on 22 Oct 2019
Latest activity Commented on by Steven Lord
on 22 Oct 2019
My result needs to be
x=(.00001,.0001,.001,.01,.1,1,10,100,1000,10000)
and i just cant figure out how to get that in a simpler form to plot in a graph against a y value of
y=280*((x./200).^(0.2)+1)
I keep getting the error "Vectors must be the same length" and I dont know how to plot this
I have tried to use something like
for (.0001<=x)&&(x<=1000000000)
x=.0001
x=x*10
y=x+2
plot(x,y,'o')
hold on
end
hold off
But that just doesnt work

  0 Comments

Sign in to comment.

Products


Release

R2019a

1 Answer

Answer by David Hill on 22 Oct 2019

x=10.^(-5:4);
y=280*((x./200).^(0.2)+1);
semilogx(x,y);

  1 Comment

That's one way. The logspace function may also be of interest.

Sign in to comment.