LINK BETWEEN TEXT AND AXES

I've got a GUI with 3 axes and 6 values of max and min peaks. I write the text command and i need to put a string or something like that because it show's all values in one axes(like in the picture):
This is one of the three codes(for displacement,i've got another 2 same for speed and acceleration):
t=0:0.1:6;
n=10/64;
omega=(2*pi*n);
S=0.275;
d=S*(1-cos(omega*t))/2;
plot(handles.axes1,omega*t,d);
hold on
MaxValue=max(d);
IndexMaxValue=find(d==MaxValue);
plot(handles.axes1, omega.*t(IndexMaxValue), MaxValue, 'r*');
text(omega.*t(IndexMaxValue), MaxValue, num2str(MaxValue));
hold on
MinValue=min(d);
IndexMinValue=find(d==MinValue);
plot(handles.axes1, omega.*t(IndexMinValue), MinValue, 'r*');
text(omega.*t(IndexMinValue), MinValue, num2str(MinValue));
hold on
Please help me!I need this file tomorow!

 채택된 답변

Walter Roberson
Walter Roberson 2013년 4월 27일

0 개 추천

Where you have
text(omega....)
add in a new first parameter,
text(handles.axes1, omega....)

댓글 수: 3

m c
m c 2013년 4월 27일
I've tried this, but if i put
text(handles.axes1, omega*t(IndexMaxValue), MaxValue, num2str(MaxValue));
the values disappear :
Okay, instead of using the handle as the first parameter, use a 'Parent' name/value parameter, such as
text(omega.*t(IndexMinValue), MinValue, num2str(MinValue), 'Parent', handles.axes1);
m c
m c 2013년 4월 28일
It works!!!!!Thank you verrrrrrrry muchhh!!!

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Data Type Conversion에 대해 자세히 알아보기

제품

태그

질문:

m c
2013년 4월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by