Why does pzoptions.FreqUnits have no effect on pzplot?

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 个评论

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.

请先登录,再进行评论。

回答(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.
.

类别

帮助中心File Exchange 中查找有关 Plot Customization 的更多信息

产品

版本

R2021b

提问:

M
M
2021-12-16

回答:

2021-12-17

Community Treasure Hunt

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

Start Hunting!

Translated by