Is there a Matlab function to convert a plot into a matrix or image?

10 ビュー (過去 30 日間)
Stuart Smith
Stuart Smith 2022 年 9 月 24 日
コメント済み: Stuart Smith 2022 年 9 月 24 日
If I write something like this
x=1:128;
y=exp(-x.^2/128)
p=plot(x,y); % I want to convert the plot on the screen to a matrix or image under program control.
can I write Matlab code to convert the plot I see on the screen to a matrix or image? I don't want to do this manually with "Save As", that is, I want to be able to automatically convert a series of plots into matrices or images.

採用された回答

the cyclist
the cyclist 2022 年 9 月 24 日
編集済み: the cyclist 2022 年 9 月 24 日
I assume you mean that you want to do it programatically, as opposed to interactively.
I'm a creature of habit, and I generally use the print function to save a figure to an image file. There are other options, such as exportgraphics and saveas.
  1 件のコメント
Stuart Smith
Stuart Smith 2022 年 9 月 24 日
'saveas' does exactly what I want. Thanks!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by