Getting single answer for function with an array
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi there,
Im trying to plot a graph of Drag against velocity. The velocity(V) in which is stored in an array from 20 to 100 in increments of 10. however when i calculate drag (D) the code only outputs a single output for drag instead of one output for each velocity.
Any help would be appreciated ,
Thank you
>> d=1.225;
>> S=50;
>> Cd=0.03;
>> K=0.04;
>> W=50;
>> V=[20:10:100];
>> D=((0.5)*d*(V.^2)*S*Cd+(K*W^2))/((0.5*d*(V.^2)*S))
0 Commenti
Risposte (1)
Torsten
il 16 Apr 2022
D=(0.5*d*V.^2*S*Cd+K*W^2)./(0.5*d*V.^2*S)
instead of
D=((0.5)*d*(V.^2)*S*Cd+(K*W^2))/((0.5*d*(V.^2)*S))
3 Commenti
Vedere anche
Categorie
Scopri di più su Logical in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!