Why does pzoptions.FreqUnits have no effect on pzplot?
Show older comments
I'm trying to change the units of a pzplot from the default rad/s to Hz, but it's not working. The script below contrasts pzplot with bodeplot, which has similar options. The figures show that FreqUnits works for bodeoptions, but not pzoptions. According to the documentation, it should work for both. Are the units not supposed to change, am I missing something, or is this a bug?
clear all; close all; clc;
bodeopts = bodeoptions;
bodeopts.FreqUnits = 'Hz';
bodeopts.Grid = 'on';
pzopts = pzoptions;
pzopts.FreqUnits = 'Hz';
pzopts.Grid = 'on';
sys = tf(1.033017668127735,[0.000000017561300,0.000106437713305,1.051464412201444]);
pzplot(sys,pzopts)
figure
bodeplot(sys,bodeopts)


1 Comment
Voss
on 17 Dec 2021
I don't have this toolbox, so this comment may be irrelevant, but a Hz is the same as a second^-1, so technically the unit is correct. Why it's not labelled as 'Hz' I couldn't say.
Answers (1)
The options sturcture is being apploied correctly. To see this, it’s necessary to compare the default ‘rad/sec’ plot with the ‘Hz’ plot.
Rearranging the code a bit and adding a default pzplot call demonstrates this —
bodeopts = bodeoptions;
bodeopts.FreqUnits = 'Hz';
bodeopts.Grid = 'on';
sys = tf(1.033017668127735,[0.000000017561300,0.000106437713305,1.051464412201444]);
figure
pzplot(sys) % rad/sec Plot
grid
pzopts = pzoptions;
pzopts.FreqUnits = 'Hz';
pzopts.Grid = 'on';
figure
pzplot(sys,pzopts)
figure
bodeplot(sys,bodeopts)
Experiment with other options as well.
.
Categories
Find more on Plot Customization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

