saveas throws "Invalid Simulink object handle" error
古いコメントを表示
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.
回答 (1 件)
TAB
2011 年 9 月 20 日
hist not returns the figure handle. See 'help hist'.
Try
h2=figure(2);
hist(variable1(:,2),50);
カテゴリ
ヘルプ センター および File Exchange で Creating, Deleting, and Querying Graphics Objects についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!