Defining a save name

조회 수: 6 (최근 30일)
kyle lyth
kyle lyth 2011년 4월 5일
file_name = input('what is the file name? \n')
SAVEAS(figure(1),file_name,'fig')
hi i am a complete novice at matlab, i have the code above which i want to use to save my figure, i want however the user to define the file name?.. is this even possible any help would be great, thanks in advance
Kyle

채택된 답변

Sean de Wolski
Sean de Wolski 2011년 4월 5일
file_name = input('what is the file name? \n','s')
Note the 's' at the end of input. It will return a string now not a number which can be used as a valid file name. Welcome to MATLAB Answers!
  댓글 수: 1
kyle lyth
kyle lyth 2011년 4월 5일
thank's' you so much.. 15 minutes on here beats the 3 hours of google answer any day :)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Printing and Saving에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by