フィルターのクリア

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

4 ビュー (過去 30 日間)
Vincenzo Bianco
Vincenzo Bianco 2019 年 5 月 3 日
編集済み: Rik 2019 年 5 月 3 日
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 Center および File ExchangeDevelop 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