Effacer les filtres
Effacer les filtres

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

4 vues (au cours des 30 derniers jours)
Vincenzo Bianco
Vincenzo Bianco le 3 Mai 2019
Modifié(e) : Rik le 3 Mai 2019
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

Réponses (0)

Catégories

En savoir plus sur Develop Apps Using App Designer dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by