Can't connect all the dots with a line

5 visualizaciones (últimos 30 días)
Kevin Tai
Kevin Tai el 29 de Oct. de 2019
Comentada: Kevin Tai el 29 de Oct. de 2019
Hi there, still learning here. I have a small question where how do I connect all the points with a line? I can't seem to get it even after using different functions.
Any help is greatly appreaciated!
c = 0.2;
Re = 386639;
V = 27.78;
b = 0.8:0.02:1.2;
alpha_Lmax = 17.2;
alpha_Lzero = -4.3;
C_lmax = 1.508306;
C_lzero = 0.4527213;
c_d0 = 0.01188282;
rho_0 = 1.225;
rho = 1.202;
R = 287.057;
mew_0 = 1.789e-5;
mew = 1.7284e-5;
alpha = 0;
v = 1.4370e-5;
a_airfoil = C_lmax/(alpha_Lmax-alpha_Lzero);
for i = 1:length (b)
a_wing = a_airfoil/(1+(57.3*a_airfoil)/(pi*0.7*(b(i)/c)));
C_L = a_wing*(alpha-alpha_Lzero);
L = 0.5*rho*(V^2)*b(i)*c*C_L;
C_Di = (C_L^2)/(pi*0.7*(b(i)/c));
C_D = c_d0 + C_Di;
ratio = C_L/C_D;
plot (b(i),ratio,'x')
hold on
end
grid on
xlabel('Span (m)')
ylabel('CL/CD')
title('CL/CD vs Span')
  2 comentarios
Rik
Rik el 29 de Oct. de 2019
This time I edited your question for you. Next time, please use the tools explained on this page to make your question more readable.
Kevin Tai
Kevin Tai el 29 de Oct. de 2019
Oh thank you very much. There's more for me to learn here it seems cause this is my first question posted to here.

Iniciar sesión para comentar.

Respuesta aceptada

Rik
Rik el 29 de Oct. de 2019
Editada: Rik el 29 de Oct. de 2019
Store the ratio in an array:
%rest of your code
ratio=zeros(size(b));
for i=length(b)
%rest of your code
ratio(i) = C_L/C_D;
end
plot(b,ratio,'-x')

Más respuestas (0)

Categorías

Más información sobre Discrete Data Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by