Borrar filtros
Borrar filtros

Error using plot: Unrecognized property LineWidth for class Line

131 visualizaciones (últimos 30 días)
Ramon Gomez
Ramon Gomez el 15 de Dic. de 2022
Comentada: Voss el 15 de Dic. de 2022
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);

Respuesta aceptada

Voss
Voss el 15 de Dic. de 2022
Editada: Voss el 15 de Dic. de 2022
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 comentarios
Ramon Gomez
Ramon Gomez el 15 de Dic. de 2022
Thank you very much, it already worked.
I copied the code from the book and it made automatically the spaces

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by