saving a figure as .png with name of a parameter

조회 수: 2 (최근 30일)
rania
rania 2018년 6월 25일
댓글: rania 2018년 6월 25일
Hallo everyone, I am trying to save a fig as an image (.png) but I want the .png file to have a specific name of one parameter. For exapmle, I have created the str called "name"
name=strcat('quicklook_',dd, '/', mm, '/', yyyy);
and I am trying to save it with the following command
print(name,'-dpng','-r300')
but it doesn't work.
Any ideas?
  댓글 수: 2
Rik
Rik 2018년 6월 25일
What do you mean with doesn't work? Do you get an error? You are aware that slashes in filenames generally result in folders being created?
rania
rania 2018년 6월 25일
Yes you are right. I was just confused and I couldn't think of the limitation of "/" in saving a filename in general

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

채택된 답변

ES
ES 2018년 6월 25일
You cant have "/" in your file names. Can you be happy with say
name=strcat('quicklook_',dd, '_', mm, '_', yyyy);
?

추가 답변 (1개)

rania
rania 2018년 6월 25일
Ohhh I didn't thought of it. I was confused because I used "/" in the title of the figure, but you are absolutely right. Thank you a lot!

카테고리

Help CenterFile Exchange에서 Computer Vision with Simulink에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by