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

9 vues (au cours des 30 derniers jours)
Edward Rosa
Edward Rosa le 22 Oct 2019
Commenté : Steven Lord le 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

Réponses (1)

David Hill
David Hill le 22 Oct 2019
x=10.^(-5:4);
y=280*((x./200).^(0.2)+1);
semilogx(x,y);
  1 commentaire
Steven Lord
Steven Lord le 22 Oct 2019
That's one way. The logspace function may also be of interest.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Line Plots dans Help Center et File Exchange

Produits


Version

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by