Error using plot: Unrecognized property LineWidth for class Line

131 次查看(过去 30 天)
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

请先登录,再进行评论。

更多回答(0 个)

标签

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by