Borrar filtros
Borrar filtros

How to make a root locus plot square aspect ratio

10 visualizaciones (últimos 30 días)
Daniel
Daniel el 7 de Oct. de 2015
Comentada: Star Strider el 8 de Nov. de 2023
I have tried:
s = tf('s');
sysL = (s^2+1)/(s*(s^2+4));
rlocus(sysL);
v=[-4 4 -4 4];
axis(v);
axis('square');
But I get a message that says: Warning: This plot type does not support this option for the "axis" command.
I am using 2013b

Respuesta aceptada

Star Strider
Star Strider el 7 de Oct. de 2015
Editada: Star Strider el 7 de Oct. de 2015
It does not support axis('square'). It does support axis('equal'), but that overrides your axis(v) call.
You can override the aspect ratio with the 'Position' figure property:
s = tf('s');
sysL = (s^2+1)/(s*(s^2+4));
rlocus(sysL);
v=[-4 4 -4 4]; axis(v);
hpos = get(gcf, 'Position'); % Get 'Position'
set(gcf, 'Position',[hpos([1 2 4]) hpos(4)]) % Set Width = Height
Experiment to get the result you want.
  4 comentarios
Ryszard Nowacki
Ryszard Nowacki el 8 de Nov. de 2023
Is there any way to do this with the R2023b version?
Star Strider
Star Strider el 8 de Nov. de 2023
@Ryszard Nowacki — I just now tested that same code here (R2023b), and it seems to work correctly.
Comparing them —
s = tf('s');
sysL = (s^2+1)/(s*(s^2+4));
figure
rlocus(sysL);
figure
rlocus(sysL);
hpos = get(gcf, 'Position'); % Get 'Position'
set(gcf, 'Position',[hpos([1 2 4]) hpos(4)]) % Set Width = Height
axis('equal');
It works as desired in R2023b.
.

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by