I understand that you want to read variables from a ‘.mat’ file and display the variables on app designer.
- In the App Desginer add a button to trigger the file selection process
- Add a call back function to the button.
- Inside the callaback function you can use ‘uigetfile’ function to read ‘.mat’ file
- Extract the variables using ‘getfieldnames’ function.
- Use a uicomponent like ‘uitable’to display the variables read.
function ButtonPushed(app, event)
[filename, pathname] = uigetfile('*.mat', 'Select the MAT file');
matfile = fullfile(pathname, filename);
data=load(matfile);
variables = fieldnames(data);
app.ListBox.Items = variables;
end
Please refer the attached ‘.malpp ‘ file.
To know more about ‘uigetfile’, ‘fieldnames’ functions, refer the following MATLAB documentations