How to i plot curve graph for equation with condition?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
i want to plot this equation into graph.. but i only got a straight line..
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/496658/image.jpeg)
a=3;
l=0.15;
m=0.5;
D=0.4;
wn=sqrt(9.81/l);
t = 0:0.05:(a*pi/wn);
x0=(D/2)*(1-cos(wn/a)*t);
plot(t,x0)
attached with me is graph i want to visualize...
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/496663/image.jpeg)
0 Commenti
Risposte (1)
langrg
il 22 Gen 2021
A parenthesis is missing in your formula (look your print), there is an closing parenthesis after "t", but there is no opening parenthesis associated.
I've tried this, that seems to work:
a=3;
l=0.15;
m=0.5;
D=0.4;
wn=sqrt(9.81/l);
t = 0:0.05:(a*pi/wn);
x0=(D/2)*(1-cos((wn/a)*t));
plot(t,x0);
Vedere anche
Categorie
Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!