Saving with filename from excel

1 visualizzazione (ultimi 30 giorni)
Siva Ratnasingam
Siva Ratnasingam il 23 Mag 2018
Commentato: Paolo il 23 Mag 2018
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 Commenti
Siva Ratnasingam
Siva Ratnasingam il 23 Mag 2018
It works.
Thank you very much Paolo
Paolo
Paolo il 23 Mag 2018
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.

Accedi per commentare.

Risposta accettata

Paolo
Paolo il 23 Mag 2018
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')

Più risposte (0)

Categorie

Scopri di più su Printing and Saving in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by