How to plot an equation with different parameter value?
Mostra commenti meno recenti
x = 0:0.01:+10;
c = 1;
Y = (1-x.^2).^c;
plot(x,Y); hold on;
c = 1.1;
Y = (1-x.^2).^c;
plot(x,Y); hold on;
c=1.4;
Y = (1-x.^2).^c;
plot(x,Y); hold on;
c=0.3;
Y = (1-x.^2).^c;
plot(x,Y)
I am sure there is a concise way to do this same thing. I want to plot the equation y = (1-x^2)^c for c = [1, 1.1, 1.4, 0.3]. How to achieve that? In general how to plot an equation with varying parameter value chosen from an array?
1 Commento
Torsten
il 12 Gen 2022
It's correct as you proceed. But for Y to be real, x must be in [-1:1].
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Mathematics in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

