필터 지우기
필터 지우기

How do I get a string to change everytime my xMax value changes?

조회 수: 1 (최근 30일)
Mo_B
Mo_B 2017년 1월 12일
댓글: Mo_B 2017년 1월 16일
Hi guys, I want the string '47.4' to change everytime the xMax value changes,
x=linspace(0, 80, 200);
y4=@(x) (0.02049/0.4)*x-(0.66*60./(1+(1.331./(sqrt(0.0631*x./(83.17-x))).^3)));
f = y4(x);
[y4Max, iMax] = max(f)
xMax = x(iMax)
y_lim = ylim;
line([xMax xMax],[y_lim(1) y4Max])
text(xMax,y4Max + 0.1,'47.4','HorizontalAlignment', 'center', 'FontSize', 15)
the string '47.4' is actually the value of xMax, but I want it to change everytime xMax changes.
Thanks a lot!

채택된 답변

Vandana Rajan
Vandana Rajan 2017년 1월 16일
Hi,
You can try
>> text(xMax,y4Max + 0.1,num2str(xMax),'HorizontalAlignment', 'center', 'FontSize', 15)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Low-Level File I/O에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by