Why app designer does not set my modified DataTip in the plot? ERROR: UNABLE TO UPDATE

조회 수: 1 (최근 30일)
My code is:
fig1 = figure('Name', "Graph");
Graph = digraph(app.G', app.U, 'omitselfloops'); %G and U are matrix and column vector
H = plot(Graph, 'NodeCData', R, 'MarkerSize', R*500, 'EdgeColor', [0.8 0.8 0.8]);
datacursormode on;
hdt = datacursormode(fig1);
disp(hdt);
hdt.UpdateFcn = @(obj, event_obj) app.GraphCursorCall(obj, event_obj, app.OUT, app.IN);
set(hdt, 'UpdateFcn', [@hdt.UpdateFcn] );
Matlab does not detect errors, but property of DataCursorManagement is not set and i don't know why.
The function to use is:
function output_txt = GraphCursorCall(~, event_obj, out, in)
% Display data cursor position in a data tip
% obj Currently not used
% event_obj Handle to event object
% output_txt Data tip text, returned as a character vector or a cell array of character vectors
pos = event_obj.Position;
output_txt = {['AGO ' num2str(pos(1), [1:length(out)])], ['OUTDEGREE: ' num2str(pos(2),out)], ['INDEGREE: ' num2str(pos(3),in)]};
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by