how do i get this to plot a graph

1 visualización (últimos 30 días)
Carl Laarakker
Carl Laarakker el 12 de Abr. de 2021
Comentada: Carl Laarakker el 12 de Abr. de 2021
close all
T= 1;
P = 4;
rs = 3.4;
lamda = 0.2;
Lss = .0011+(3/2)*.011;
rpm = 0;
wr = (P/2)*(2*pi*(rpm/60));
x = (lamda*rs)/((rs*rs)+(wr*wr)*(Lss*Lss));
new_VS = ((T*4/(x*3*P))+(wr*lamda))/sqrt(2);
total_vdc = 0;
N = 600 ;
while (rpm < N)
wr = (P/2)*(2*pi*(rpm/60));
x = (lamda*rs)/((rs*rs)+(wr*wr)*(Lss*Lss));
new_VS = ((T*4/(x*3*P))+(wr*lamda))/sqrt(2);
total_vdc = sqrt(2)*new_VS*2;
rpm = rpm + 1;
hold on
plot(rpm,total_vdc)
end
I can not seem to get this to plot. I only get blank graph. What am I doing wrong? Thank you in advance

Respuesta aceptada

David Fletcher
David Fletcher el 12 de Abr. de 2021
Editada: David Fletcher el 12 de Abr. de 2021
You are trying to plot isolated unconnected points - they can't be joined with a line so the only way you can see them is to use a marker
plot(rpm,total_vdc,'+')
This will give you a graph (of sorts), but I doubt it is what you want.
Try this:
T= 1;
P = 4;
rs = 3.4;
lamda = 0.2;
Lss = .0011+(3/2)*.011;
rpm = 0;
wr = (P/2)*(2*pi*(rpm/60));
x = (lamda*rs)/((rs*rs)+(wr*wr)*(Lss*Lss));
new_VS = ((T*4/(x*3*P))+(wr*lamda))/sqrt(2);
total_vdc = 0;
N = 600 ;
iter=1;
while (rpm < N)
wr = (P/2)*(2*pi*(rpm/60));
x = (lamda*rs)/((rs*rs)+(wr*wr)*(Lss*Lss));
new_VS = ((T*4/(x*3*P))+(wr*lamda))/sqrt(2);
total_vdc(iter) = sqrt(2)*new_VS*2;
Y(iter) = rpm;
iter=iter+1;
rpm = rpm + 1;
end
plot(Y,total_vdc)
  1 comentario
Carl Laarakker
Carl Laarakker el 12 de Abr. de 2021
thats my result that appears to be right
THANK YOU!!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre MATLAB 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