Add text description to point of a selected subplot

Hi
I plot bode diagram of a transfer function in matlab by bode(F) function in matlab livescript. As it is known this plot consist of two subplot: upper is amplitude and lower plot is phase. I am trying to add a text description to a point in upper plot but when I use the text command it draws in the lower phase plot. Can you guide me how to add text to upper plot?

 채택된 답변

Alberto Mora
Alberto Mora 2021년 2월 11일
편집: Alberto Mora 2021년 2월 11일
Just point to the first subplot using simply:
subplot(2,1,1);
text(x,y,'my text here') % EDIT: This method does not work, see below
EDIT: plot manually the bode, as described below!

댓글 수: 4

bode(Ia_ph_A_2);
subplot(2,1,1);
Point_1 = ['\leftarrow ' 'Freq= ' num2str((w1 + w))];
text((w1 + w),mag2db(alpha_A_1),Point_1)
it is not working. I have almost tried it... It just add a new empty plot at the end
You are reason...
The only suggestion that I can give you is to plot the bode "manually".
[mag,phase,w]=bode(MyModel); % Extract magnitude, phase and pulsation
figure('name','MyFig'); % Then plot the arrays
subplot(2,1,1)
loglog(w/(2*pi),squeeze(mag));
Point_1 = ['\leftarrow ' 'Freq= ' num2str((w1 + w))];
text((w1 + w),mag2db(alpha_A_1),Point_1)
subplot(2,1,2)
semilogx(w/(2*pi),squeeze(phase));
Hope that can help you. Maybe other users can help you more efficently.
That solved my problem. Thanks for your time.
Alberto Mora
Alberto Mora 2021년 2월 11일
편집: Alberto Mora 2021년 2월 11일
If that solved the problem, please, accept the answer as sign of gratitude. That can help other user to see that your problem was fixed.
Thaks you and best regards. A-

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

추가 답변 (0개)

카테고리

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

제품

태그

질문:

2021년 2월 11일

편집:

2021년 2월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by