Id like to have absolute gain as it generates the plot instead of having to do it manually. I was able to change frequency from rad to hz. not sure about the db to absolute. Thank you

댓글 수: 1

rockstar49
rockstar49 2022년 10월 12일
Hi,
Is it something that can be done like this?
h = gcr
setoptions(h,'FreqUnits','Hz')

댓글을 달려면 로그인하십시오.

답변 (2개)

Chunru
Chunru 2022년 10월 12일

0 개 추천

H = tf([1 0.1 7.5],[1 0.12 9 0 0]);
[mag,phase,wout] = bode(H);
subplot(211); plot(wout, squeeze(mag(1,1,:)))
subplot(212); plot(wout, squeeze(phase(1,1,:)))
figure;
bode(H)

댓글 수: 6

rockstar49
rockstar49 2022년 10월 12일
이동: Chunru 2022년 10월 12일
HI this solution works as well but is there an option to do it this way
h = gcr
setoptions(h,'FreqUnits','Hz')
etc
rockstar49
rockstar49 2022년 10월 12일
Please see below, thank you
Chunru
Chunru 2022년 10월 12일
이동: Chunru 2022년 10월 12일
H = tf([1 0.1 7.5],[1 0.12 9 0 0]);
[mag,phase,wout] = bode(H);
subplot(211); plot(wout/(2*pi), squeeze(mag(1,1,:)))
subplot(212); plot(wout/(2*pi), squeeze(phase(1,1,:)))
xlabel('f(Hz)')
rockstar49
rockstar49 2022년 10월 12일
Hi,
Is it something that can be done like this?
h = gcr
setoptions(h,'FreqUnits','Hz')
Chunru
Chunru 2022년 10월 12일
편집: Chunru 2022년 10월 12일
No (unless you write your own class for creating the figure and set your own object property). Why do you need to do it that way?
rockstar49
rockstar49 2022년 10월 12일
It is a property setting on the figure, I can easily change it manually. I did the same thing for the frequency from rad to hz. im sure there is a way to do the same from db to absolute gain

댓글을 달려면 로그인하십시오.

Paul
Paul 2022년 10월 12일

0 개 추천

Can be done if using bodeplot instead of bode
H = tf([1 0.1 7.5],[1 0.12 9 0 0]);
h = bodeplot(H);
setoptions(h,'MagUnits','abs','FreqUnits','Hz')

카테고리

도움말 센터File Exchange에서 Plot Customization에 대해 자세히 알아보기

제품

릴리스

R2017b

질문:

2022년 10월 12일

답변:

2022년 10월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by