How to automatically update MATLAB GUI axes handles?
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Feri
am 20 Feb. 2020
Beantwortet: Steven Lord
am 20 Feb. 2020
Hello,
I created an application with MATLAB GUI that has several sections, each section has multiple push buttons, and at the end of each there is a figure that needs to be updated.
My question is: how can I pass the output of a callback function to the figure handle so that it gets updated as soon as the output is produced?
The figure is a scattered plot of a point cloud data, what I want is for example when I load in a file, it automatically shows the raw data (say OUTPUT = RAW), then when I process the data it should automatically update the figure with (OUTPUT = Processed). Without writing a few lines again to pass the Processed to figure handle.
Any help is much appreciated.
0 Kommentare
Akzeptierte Antwort
Steven Lord
am 20 Feb. 2020
Callback functions don't have outputs, at least not how they are called by the usual workflow of a UI in MATLAB.
I'd probably write a function that your pushbutton callbacks can use to set the status message appropriately, something like:
function setStatusMessage(f, newmessage)
f.statusWindow.String = newmessage;
end
where statusWindow is the component in the figure that contains the status message.
That's also pretty self-documenting.
function gridSmoothedData_Callback(...)
% Do some processing on the data
setStatusMessage(f, "Processed");
% Maybe call the next step in the process
updateSmoothedDataVisualization(...);
end
Without even seeing what the function accepts can you tell the purpose of this callback, what the state of the process is when this function finishes, and what the next step is?
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!