Save Histogram data without figure

10 ビュー (過去 30 日間)
Annagrazia Pedicini
Annagrazia Pedicini 2018 年 6 月 7 日
コメント済み: Rik 2018 年 6 月 7 日
Hi, I want to save a histogram figure in a folder out of matlab but i do not want that the figure appears on matlab. How can i do this?

採用された回答

Rik
Rik 2018 年 6 月 7 日
You can create a figure with the Visible property set to 'off'.
f=figure('Visible','off');
X=randi(15,1,100);
histogram(X,'Parent',f);
saveas(f,'test.png')
close(f)
  4 件のコメント
Annagrazia Pedicini
Annagrazia Pedicini 2018 年 6 月 7 日
I tried to use print instead of saveas, and I use this command: print(percorso,'-dtiff'); where "percorso" is the path of the folder where the image has to be saved. But it returns this error:
Cannot create output file 'C:\Users\Annagrazia\Desktop\Progetto\Cartella\Istogramma_Immagine_01.tif'. Error in print (line 71) pj = name( pj );
How can I change the path where print save the figure? Thanks for helping!!
Rik
Rik 2018 年 6 月 7 日
I don't see any reason why that would fail. What is the complete code you're using? (please use the {}Code button to format your code)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by