saveas throws "Invalid Simulink object handle" error
Afficher commentaires plus anciens
Hello All,
I am trying to save a plot in .png format. I am using a code which looks something like this:
figure (2)
h2 = hist(variable1(:,2),50);
xlabel('Error');
ylabel('Error Distribution');
string1 = strcat('Histogram',10,'Variable1'); %10 is added for \n
title(string1);
saveas(h2,'better_system\hist_variable1.png');
when I run this piece of code, I see the following error:
??? Error using ==> saveas at 73 Invalid Simulink object handle.
Réponses (1)
TAB
le 20 Sep 2011
hist not returns the figure handle. See 'help hist'.
Try
h2=figure(2);
hist(variable1(:,2),50);
Catégories
En savoir plus sur Creating, Deleting, and Querying Graphics Objects 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!