Plot multiple graph using 'hold on' and loop function
Afficher commentaires plus anciens
Hi everyone. I am trying to plot multiple graph in Matlab. The equation is power law y=ax^n. The value of "n" varies from 0.1 to 1 and value of "a" also varies and accordingly y is calculated by varying x. The code i have written is below. Please suggest any solutions.
n=0.1:0.1:1;
x=0.1:0.1:3;
while (n<1.1)
a=1/3^n;
y=a*x.^n;
plot (x,y)
hold on
n=n+0.1;
x=x+o.1;
end
Réponses (2)
Catégories
En savoir plus sur Animation dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!