How do I program my app to export a file to Windows File Explorer?

2 visualizaciones (últimos 30 días)
Leonardo Pisco
Leonardo Pisco el 29 de Abr. de 2018
Editada: Jan el 30 de Abr. de 2018
I am currently designing an app using Matlab's App Designer that processes audio and my query is very simple: I want to program a button so that when it gets pushed a Windows File Explorer (or Finder in OS) window shows up and I can save my file with a specified name and location as I would normally proceed in any other standard program.
I already know of '[file,path]= uiputfile({'*.*'});' but it doesn't create any file when I save it..
I have to join it with this line of code 'audiowrite(filename,app.audio,app.fs);' but I'm not sure how to!
Please help guys! Thanks in advance!

Respuestas (1)

Jan
Jan el 30 de Abr. de 2018
Editada: Jan el 30 de Abr. de 2018
[file, folder] = uiputfile('*.wav');
if ~isequal(file, 0) % User did not press Cancel:
audiowrite(fullfile(folder, file), app.audio, app.fs);
end
Compare this with the example for xlswrite at the bottom of the documentation: doc uiputfile (link)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by