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

17 visualizaciones (últimos 30 días)
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.

Respuestas (1)

Shreeya
Shreeya el 27 de Feb. de 2024
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 comentario
Fabio
Fabio el 27 de Feb. de 2024
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

Iniciar sesión para comentar.

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by