Can I give input arguments while referencing a callback function?
Ältere Kommentare anzeigen
I'm new to object oriented MATLAB so bear with me.
I am plotting some data from my class S, as
Plot(s.X{i},s.Y{i},s.Data{i},...
set(gcf,'Name','Data1');
filepath = s.DirPath{1,i});
set(gca,'ButtonDownFcn',@mycallback);
Now I want to give this 'filepath' as one of the input argument for my callback function. But when I try to use filepath, it doesn't recognize it.
I also tried
set(gcf,'Tag',s.DirPath{1,i});
set(gca,'ButtonDownFcn',@mycallback);
and
get('Tag');
within my callback function.
Any help?
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Interactive Control and Callbacks finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!