how do i get this to plot a graph

1 vue (au cours des 30 derniers jours)
Carl Laarakker
Carl Laarakker le 12 Avr 2021
Commenté : Carl Laarakker le 12 Avr 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

Réponse acceptée

David Fletcher
David Fletcher le 12 Avr 2021
Modifié(e) : David Fletcher le 12 Avr 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 commentaire
Carl Laarakker
Carl Laarakker le 12 Avr 2021
thats my result that appears to be right
THANK YOU!!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by