how to save a file into another folder by using uiputfile
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello,
I have a matlab based programmatic gui. The user clicks on the save pushbutton. the pushbutton calls a callback function. The function creates the 'output.dat' file. Then, uiputfile asks the user where to save the .dat file. Everything so far is fine. However, I cannot save the file with the user specified name into the desired folder. I tried many functions such as copyfile, movefile,save but none worked. Can you help me please? Below there is an example function. It would also be nice to be able to save with the user specified format.
Thank you,
emre
fileID = fopen('output.dat','wt');
fprintf(fileID,'write something.');
[filename, pathname] = uiputfile('output.dat');
fclose(fileID);
save(filename,pathname,'f')
0 comentarios
Respuesta aceptada
Oleg Komarov
el 5 de Ag. de 2012
Editada: Oleg Komarov
el 5 de Ag. de 2012
If you can ask where to put it first then you can simply solve your problems with:
fileID = fopen('...\chosenDir\output.dat','wt');
i.e. you can write the file directly to the chosen directory.
1 comentario
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!