How can I save a file in the directory where the user chooses the file location and file name?

2 次查看(过去 30 天)
I want to create a save function to save .mat files with specific variables in the workplace. I'm aware that
save(filename, variables)
will save my variables within the program under a specified folder name. However I want the user to be able to save wherever they want, and to save with a name of their choice.
For example, in Microsoft Word, you can save your file wherever you want in your directory and choose it's name. I want to know how to do the same thing for my program.
.
If this isn't applicable, I would at least like to know how to get the file name they input themselves, and have a designated folder outside the program. I can't find any answers to this question :(
  3 个评论
Brianna Florio
Brianna Florio 2018-6-6
Thank you! This worked!
But now I have a follow up question, how do you allow the user to load a file of their choice? Is it the same function or a different function?
Paolo
Paolo 2018-6-6
You are welcome, I believe that for loading a file what you want is uiopen. If that solved the problem, let me know and I will write up an answer for your question, for it to be accepted and for the question to be closed.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 File Operations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by