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 个评论
Voss
2021-12-17
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 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


