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