Insert a string in a code to export a figure
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi,
This is code:
...
name='location';
options.Format = 'tiff';
hgexport(gcf, 'name.tif', options);
....
Can the 'location' be inserted to " name.tif" (replace 'name' by 'location')?
The exported filename is 'location.tif' (NOT 'name.tif').
0 commentaires
Réponse acceptée
Guillaume
le 20 Oct 2015
hgexport(gcf, sprintf('%s.tif', name), options);
%or
hgexport(gcf, [name, '.tif'], options);
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Printing and Saving dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!