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

4 ビュー (過去 30 日間)
nisha s
nisha s 2019 年 4 月 25 日
コメント済み: Rik 2020 年 2 月 27 日
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 件のコメント
Walter Roberson
Walter Roberson 2019 年 4 月 25 日
Did you happen to switch from using LiveScript to using a regular script ?
Adam Danz
Adam Danz 2019 年 4 月 25 日
編集済み: Adam Danz 2019 年 4 月 25 日
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.

サインインしてコメントする。

回答 (2 件)

Ivan Gonzalez Bustos
Ivan Gonzalez Bustos 2020 年 2 月 27 日

Adam Danz
Adam Danz 2019 年 4 月 25 日
編集済み: Adam Danz 2019 年 4 月 25 日
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......

カテゴリ

Help Center および File ExchangeEntering Commands についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by