Change Data Cursor text

조회 수: 13 (최근 30일)
Teresa
Teresa 2011년 8월 5일
Hello, i try to change the data tip of the data cursor and use this function:
function txt = myupdatefcn(empt,event_obj)
% Customizes text of data tips
handles = getappdata(gcf,'mydata');
pos = get(event_obj,'Position');
flux = handles.S.PoolNames(pos(1));
pool = handles.S.FluxNames(pos(2));
wert = handles.S.Stoich(pos(2),pos(1));
txt = {['Flux: ',flux{1}],['Pool: ',pool{1}],['Wert: ',wert{1}]};
In the OpeningFcn of the gui i call this function:
dcm = datacursormode(hObject);
set(dcm,'Enable','on','UpdateFcn',@myupdatefcn);
But it did not work and I can't find my mistake. Can anyone help me?
  댓글 수: 1
Oleg Komarov
Oleg Komarov 2011년 8월 5일
Did not work? Error or unexpected result?

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

채택된 답변

Teresa
Teresa 2011년 8월 5일
The problem was the string
now i tried:
txt = sprintf('Flux: %s\nPool: %s\nWert: %d.2',flux{1},pool{1},wert);
and this work

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by