Saving with filename from excel

1 次查看(过去 30 天)
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 中查找有关 Printing and Saving 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by