Invalid handle Error in Saveas command
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi,
I am encountering Invalid Handle Error in saveas command. I am able to display the spectrogram images in for loop, but not able to save them in a specified folder.
fig = specgram(--------------------------------);
cpath = 'c:Users\Desktop\name';
gca = fig;
saveas(gca,fullfile(cpath,filename), 'jpeg');
Thanks in advance
0 commentaires
Réponse acceptée
Jan
le 24 Mar 2021
Modifié(e) : Jan
le 24 Mar 2021
Do not shadow the built-in function "gca".
The first output of specgram is y, not the figure handle. If you want to get the handle, use gcf.
specgram(--------------------------------);
cpath = 'c:Users\Desktop\name';
saveas(gcf, fullfile(cpath,filename), 'jpeg');
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Audio and Video Data 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!