Saving a figure as a png with a specific name from predefined variable
Afficher commentaires plus anciens
I would like to save a figure as a png with the name as a value that I had already predefined in the code. The code below is not calling that value. My variable that I would like to use as the name of the png is defined as plottitle.
I keep getting an error that says invalid filename.
plottitle is my variable
saveas(gcf,plottitle.bmp)
Output: Error using saveas (line 96)
Invalid filename.
1 commentaire
Jan
le 22 Jan 2019
"Invaluid filename" is a surprising message. If plottitle is a string, which contains the name of the file, plottitle.bmp is interpreted as the access of the field bmp of a struct. Then the error message should be different.
It is recommended to post running examples. As soon as you show how plottitle is defined, the actual problem would be clear.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Data Import and Analysis dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!