I'm getting the error "terminate statement with semicolon to suppress output" but I haven't used any functions.
6 views (last 30 days)
Show older comments
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 Comments
Walter Roberson
on 25 Apr 2019
Did you happen to switch from using LiveScript to using a regular script ?
Answers (2)
Adam Danz
on 25 Apr 2019
Edited: Adam Danz
on 25 Apr 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......
More for info: https://www.mathworks.com/help/matlab/ref/display.html
0 Comments
See Also
Categories
Find more on Entering Commands in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!