Change rlocus() axis units to Hz?

How can I change the plotted rlocus() real axis units to Hz, vs rad/s?
I tried Property Editor --> clicking on X axis --> More Properties --> Units --> Frequency field --> Hz, but didn't seem to change the plot.
I tested with a single pole at -10, plotting 1/(s+10), and the pole remained at -10 regardless of Hz or Rad/s setting.

 Accepted Answer

First, use rlocusplot since it allows options —
sys = tf([2 5 1],[1 2 3]);
hrlp = rlocusplot(sys);
opts = getoptions(hrlp)
opts = FreqUnits: 'rad/s' TimeUnits: 'seconds' ConfidenceRegionNumberSD: 1 IOGrouping: 'none' InputLabels: [1×1 struct] OutputLabels: [1×1 struct] InputVisible: {0×1 cell} OutputVisible: {0×1 cell} Title: [1×1 struct] XLabel: [1×1 struct] YLabel: [1×1 struct] TickLabel: [1×1 struct] Grid: 'off' GridColor: [0.1500 0.1500 0.1500] XLim: {[-2.5000 0.5000]} YLim: {[-1.5000 1.5000]} XLimMode: {'auto'} YLimMode: {'auto'}
setoptions(hrlp, 'FreqUnits','Hz')
Second, it doesn’t display frequency values or units, although you can certainly set them. (The same options are available on other plot functions. For a full list of the available plot functions, see the setoptions documentation section p.)
EDIT — (25 Mar 2023 at 10:48)
Clarified code. No substantive changes.
.

3 Comments

It appears that the FreqUnits only changes the labeling and spacing of the rlocus grid circles of constant wn, but don't affect the axis nor the actual drawing of the root locus. On Answers, those grid lines don't show up automatically when using rlocusplot (they do when I run locally), have to force them using sgrid
sys = tf([2 5 1],[1 2 3]);
figure
hrlp = rlocusplot(sys);
sgrid
sys = tf([2 5 1],[1 2 3]);
figure
hrlp = rlocusplot(sys);
sgrid
opts = getoptions(hrlp);
setoptions(hrlp, 'FreqUnits','Hz')
Thanks @Star Strider and @Paul. That helped.
As always, my pleasure!

Sign in to comment.

More Answers (0)

Products

Release

R2022b

Tags

Asked:

on 24 Mar 2023

Commented:

on 28 Mar 2023

Community Treasure Hunt

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

Start Hunting!