I'm getting the error "terminate statement with semicolon to suppress output" but I haven't used any functions.

5 visualizaciones (últimos 30 días)
The code was previously displaying the graphs properly but it stopped displaying that too all of a sudden. It also shows the error "terminate statement with semicolon to suppress output".
% GIVEN DATA:
v=400; %Rated voltage
p=250000; %Power
pole=4;
rs=0.032;
rr=0.02;
ls=0.0003183;
lr=0.00047428;
lm=0.0174;
f=50; %frequency
% TORQUE SLIP CHARACTERISTICS
hold on
wms=(4.*pi.*f)./pole
xnet=2.*pi.*f.*(ls+lr)
z = sqrt( (rs+(rr./x)).^2 + (xnet.^2))
y = 3 .* (v./z).^2 .* rr ./ (x.*wms) %k=1
xlim([0 1])
plot(x,y)
wms=(4.*pi.*f)./pole
xnet=2.*pi.*f.*(ls+lr)
z = sqrt( (rs+(rr./x)).^2 + 25.*(xnet.^2))
y = -3 .* (v./z).^2 .* rr ./ (x.*wms.*25) %k=5
plot(x,y)
wms=(4.*pi.*f)./pole
xnet=2.*pi.*f.*(ls+lr)
z = sqrt( (rs+(rr./x)).^2 + 49.*(xnet.^2))
y = 3 .* (v./z).^2 .* rr ./ (x.*wms.*49) %k=7
yyaxis right
plot(x,y)
hold off
% SPEED TORQUE CHARATCERISTICS
figure(2)
hold on
wms=(4.*pi.*f)./pole
xnet=2.*pi.*f.*(ls+lr)
s = (wms - x) ./ wms
z = sqrt( (rs+(rr./s)).^2 + (xnet.^2))
y = 3 .* (v./z).^2 .* rr ./ (s.*wms) %k=1
ylim([0 10000])
xlim([0 20])
plot(x,y)
hold off
  3 comentarios
Adam Danz
Adam Danz el 25 de Abr. de 2019
Editada: Adam Danz el 25 de Abr. de 2019
I updated my answer to address the empty plots. You haven't provided a value for 'x' as Rik pointed out. When I used
x = 0 : 0.01: 5;
your plots produces lines.
I haven't looked into the code any further.

Iniciar sesión para comentar.

Respuestas (2)

Ivan Gonzalez Bustos
Ivan Gonzalez Bustos el 27 de Feb. de 2020

Adam Danz
Adam Danz el 25 de Abr. de 2019
Editada: Adam Danz el 25 de Abr. de 2019
Your sample code does not provide a value for x. When x is a vector (x = 0 : .01 : 5), your plot produce lines.
As for the semicolon warning, there are lots of lines in your code that do not end with ";" and many of those lines produce outputs to your command window. This is typically sloppy which is why Matlab is warning you. To fix it, just add the semicolon (;) to the end of those lines.
% GIVEN DATA:
v=400; %Rated voltage
p=250000; %Power
pole=4;
rs=0.032;
rr=0.02;
ls=0.0003183;
lr=0.00047428;
lm=0.0174;
f=50; %frequency
% TORQUE SLIP CHARACTERISTICS
hold on
wms=(4.*pi.*f)./pole % <--HERE
xnet=2.*pi.*f.*(ls+lr) % <--HERE
z = sqrt( (rs+(rr./x)).^2 + (xnet.^2)) % <--HERE
y = 3 .* (v./z).^2 .* rr ./ (x.*wms) %k=1 % <--HERE
xlim([0 1])
plot(x,y)
wms=(4.*pi.*f)./pole % <--HERE
xnet=2.*pi.*f.*(ls+lr) % <--HERE
z = sqrt( (rs+(rr./x)).^2 + 25.*(xnet.^2)) % <--HERE
y = -3 .* (v./z).^2 .* rr ./ (x.*wms.*25) %k=5 % <--HERE
plot(x,y)
wms=(4.*pi.*f)./pole % <--HERE
xnet=2.*pi.*f.*(ls+lr) % <--HERE
z = sqrt( (rs+(rr./x)).^2 + 49.*(xnet.^2)) % <--HERE
y = 3 .* (v./z).^2 .* rr ./ (x.*wms.*49) %k=7 % <--HERE
% You get the picture......

Categorías

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