Error using plot Vectors must be the same length.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Kseniia Kudriavtceva
le 20 Nov 2020
Commenté : Kseniia Kudriavtceva
le 20 Nov 2020
I have Dynamic question, which I solved for n.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/420378/image.png)
Use values of v_o from 1.8 m/s to 3.0 m/s in 0.2 m/s increments,values of α from 18deg to 26deg in 1deg increments,and values of k (E) equal to 0.40,0.45,and 0.50.
IN CODE I CHANGED K TO E.
% Given
V_0 = 1.8:0.2:3.0; %m/s
alpha = 18:1.0:24; %deg
n=[];
for e = [0.40, 0.45, 0.50]
k=((log(0.5.*tan(alpha)+1.47./(V_0.^2.*cos(alpha)))./(log(e))));
n = [n k'];
end
%Plot
plot(e, n,'Linewidth',2);
I'm making a mistake somewhere, so it doesn't want to show a plot to me.
Error using plot
Vectors must be the same length.
What could I change to it?
Thank you in advance!
0 commentaires
Réponse acceptée
KSSV
le 20 Nov 2020
% Given
V_0 = 1.8:0.2:3.0; %m/s
alpha = 18:1.0:24; %deg
n=[];
for e = [0.40, 0.45, 0.50]
k=((log(0.5.*tan(alpha)+1.47./(V_0.^2.*cos(alpha)))./(log(e))));
n = [n k'];
end
%Plot
e = [0.40, 0.45, 0.50]
plot(e, n,'Linewidth',2);
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Line Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!