Azzera filtri
Azzera filtri

how do i get this to plot a graph

1 visualizzazione (ultimi 30 giorni)
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

Risposta accettata

David Fletcher
David Fletcher il 12 Apr 2021
Modificato: David Fletcher il 12 Apr 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 Commento
Carl Laarakker
Carl Laarakker il 12 Apr 2021
thats my result that appears to be right
THANK YOU!!

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su MATLAB in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by