Filter löschen
Filter löschen

how to callback a code graphic with a graphic of a matlab app

1 Ansicht (letzte 30 Tage)
how to callback a code graphic with a graphic of a matlab app
Is there a way where I can just link the graphic of the code with the UIaxes of the matlab app??

Akzeptierte Antwort

Dinesh
Dinesh am 11 Mär. 2023
Hi Jose.
Firstly, I'm assuming that you have a separate MATLAB function saved as a ".m" file which generates the graphic that you want to display in the app.
Add the folder where this graphic code is stored to the path of the app.
addpath('<Folder_Path>');
Now, call the function in the app.
mygraphic = graphic_function(data); % data is the input
To link this graphic to the existing UIAxes, use "imshow".
imshow(mygraphic, 'Parent', app.UIAxes);
The parent of the graphic is the UIAxes in this case.
You can create a startupFcn from App designer and include all the above mentioned steps there if you would like to first load the graphic into the UIAxes every time the app is executed.

Weitere Antworten (0)

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by