How do I read in a file and insert it in a UIAxes plot without creating a selection menu for it.

1 vue (au cours des 30 derniers jours)
I am wondering how to read in and insert an object in UIAxes in MATLAB App Designer.

Réponses (1)

Swaraj
Swaraj le 29 Mai 2023
Hi Griffin,
I understand that you want to know how you can read in and insert an Object in UIAxes in App designer.
You may follow the following steps in MATLAB App Designer to read in and insert an object into a “UIAxes” component:
Load the object's data into the “UIAxes” before inserting it. Depending on the sort of data you are reading in, you can do this using the “load” or “imread” functions.
From the data loaded, create an image object. For instance, if the data is an image file, you can use the image or “imshow” command to construct an image object. You can generate a suitable object, such as a “scatter”, “line”, or “patch”, if the data is in another format.
Documentation for “imshow” : Display image - MATLAB imshow (mathworks.com)
Get the handle of the UIAxes component in the MATLAB App Designer. You can do this by using the app.UIAxes command, where app is the name of your App Designer app.
Insert the image object into the UIAxes component by using the hold and plot command.
For example, the code to insert an image into the UIAxes component would look like this:
img = imread('example.jpg');
axes_handle = app.UIAxes;
hold(axes_handle, 'on');
imshow(img, 'Parent', axes_handle);
Hope it helps!!

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