I plotted something but not sure why I can't adjust the linewidth of the result of the plot. I was able to change colors but linewidth doesn't change.
step(value_1);
set(value_1, 'LineWidth', 2);

 Respuesta aceptada

Star Strider
Star Strider el 24 de Feb. de 2018

2 votos

Get the outputs of the step function, then plot them using a plot call:
[y,t] = step(value_1);
figure
plot(t, squeeze(y), 'LineWidth',2)
grid
The Control System Toolbox plot functions do not allow you to alter their properties easily, if at all.

1 comentario

Maithili
Maithili el 28 de Mayo de 2026 a las 21:57
Editada: Maithili hace alrededor de 5 horas
There have been recent enhancements to customize these linear analysis plots at command line more easily. Using stepplot, this customization can be done at the time of creation of the plots or after. For example, to change the line width at the time of creation (R2026a and later), you can now do,
stepplot(sys, 'LineWidth', 2)
To customize the response after creation (R2024b and later),
sp = stepplot(sys);
sp.Responses.LineWidth = 2;

Iniciar sesión para comentar.

Más respuestas (1)

Erick Oberstar
Erick Oberstar el 20 de Mzo. de 2021

7 votos

This technique works for step, impulse, nyquist, and bode plots
LineWidth = 3;
s = tf(s)
sys = 1/(s+1)
figure; step/impulse/nyquist/bode(sys)
set(findall(gcf,'type','line'),'linewidth',LineWidth);

2 comentarios

Ajay Vaishnav
Ajay Vaishnav el 4 de Dic. de 2021
Thanks! It works.
Jose Julio
Jose Julio el 31 de Mzo. de 2025
Thanks

Iniciar sesión para comentar.

Categorías

Preguntada:

el 24 de Feb. de 2018

Editada:

el 2 de Jun. de 2026 a las 0:19

Community Treasure Hunt

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

Start Hunting!

Translated by