Saving with filename from excel

조회 수: 10 (최근 30일)
Siva Ratnasingam
Siva Ratnasingam 2018년 5월 23일
댓글: Paolo 2018년 5월 23일
Hi
I getting text from excel cell A1. This value changes for different dataset.
Question: How to use it as a filename for saving image.
I am currently using saveas(gcf,'Test.jpg');
or saveas(gca, fullfile(folderName, 'Test'),'jpeg');
Thanks
  댓글 수: 7
Siva Ratnasingam
Siva Ratnasingam 2018년 5월 23일
It works.
Thank you very much Paolo
Paolo
Paolo 2018년 5월 23일
You are welcome, I wrote an answer for the question so that other people can easily find the solution if they are facing the same problem.

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

채택된 답변

Paolo
Paolo 2018년 5월 23일
It does not work because the string contained in fname is wrapped inside a cell.
You must convert the cell to the data type contained within it.
Use:
saveas(gcf,cell2mat(fname),'jpg')

추가 답변 (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