フィルターのクリア

Error using plot: Unrecognized property LineWidth for class Line

97 ビュー (過去 30 日間)
Ramon Gomez
Ramon Gomez 2022 年 12 月 15 日
コメント済み: Voss 2022 年 12 月 15 日
Hello everyone.
I am trying to excecute a code found in the book "Mechatronics and Control of Electromechanical Systems" by Sergey Edward Lyshevski.
The code is in the page 212 and when I write it come the next error: "Error using plot: Unrecognized property LineWidth for class Line"
How can I solve the error?
I appreciate your help!
Here is the code:
th=0:0.01:4*pi;% angular rotor displacement
IM=10; P=4; LDm=0.05; phi=0.3245;
% Balanced three-phase current set
Ias=sqrt(2)*IM*sin(th+phi*pi/3); Ibs=sqrt(2)*IM*sin(th-(2-phi)*pi/3);
Ics=sqrt(2)*IM*sin(th+(2+phi)*pi/3);
% Calculation of the electromagnetic torque
Te=P*LDm*(Ias.*(sin(2*th).*Ias+2*sin(2*th-2*pi/3).*Ibs+2*sin(2*th+2*pi/3).*Ics)+Ibs.*(sin(2*th-4*pi/3).*Ibs+2*sin(2*th).*Ics)+Ics.*sin(2*th+4*pi/3).*Ics)/2;
% Plot the currents applied to the abc windings
plot(th,Ias, 'k− ',th,Ibs, 'b−− ',th,Ics, 'r: ','LineWidth ',2.5); axis([0,4*pi,-15,15]);
xlabel('Angular Displacement, \theta_r [rad] ', 'FontSize ',18);
title('Phase Currents, {\iti_a_s}, {\iti_b_s} and {\iti_c_s} [A] ', 'FontSize ',18); pause;
% Plot of the torque developed versus the angular displacement
plot(th,Te, 'k− ','LineWidth ',2.5); axis([0,4*pi,0,30]);
xlabel('Angular Displacement, \theta_r [rad] ', 'FontSize ',18);
title('Electromagnetic Torque, {\itT_e} [N-m] ', 'FontSize ',18);

採用された回答

Voss
Voss 2022 年 12 月 15 日
編集済み: Voss 2022 年 12 月 15 日
Use 'LineWidth' instead of 'LineWidth ' with a space on the end.
plot(th,Ias, 'k− ',th,Ibs, 'b−− ',th,Ics, 'r: ','LineWidth ',2.5); axis([0,4*pi,-15,15]);
% ^ this space should be removed
  3 件のコメント
Ramon Gomez
Ramon Gomez 2022 年 12 月 15 日
Thank you very much, it already worked.
I copied the code from the book and it made automatically the spaces
Voss
Voss 2022 年 12 月 15 日
You're welcome!

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

その他の回答 (0 件)

タグ

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by