How do you use App designer to read files from a folder, list the name of the variable stored, select them and save in CSV

13 次查看(过去 30 天)
I need an app that is able to look inside a .mat file, list the variable stored in there, select the ones that needs to be and save them in a directory tht needs to be selected too. It is a workplace were not everybody are able to use matlab. I was thinking at an easy way to do that.

回答(1 个)

Shreeya
Shreeya 2024-2-27
Hello
To load mat files and perform operations on them using the app designer, you can use, for example, the button component and define a callback function for a click event. Load the mat file as an app property as follows:
% Button pushed function: Button
function ButtonPushed(app, event)
app.file = load('file.mat');
end
Further, you can implement the other required functionalities in the callback functions of same/other components which can access the file contents using the app.file property. Refer to the following link to learn more:
  1 个评论
Fabio
Fabio 2024-2-27
It does not work, below the error. But more than this, the button is to load a file I know the name. What I am looking for is something really different. After clicking the button (or whatever is good for the following) a sort of menu needs to be opened, showing directories and files so I can change directory and choose the file I need to.
Unrecognized property 'file' for class 'app1'
% Button pushed function: LoadmatfileButton
function LoadmatfileButtonPushed(app, event)
app.file = load('240220_115913.mat');
end

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Develop Apps Using App Designer 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by