Figure に表示された内容を画​像データとして取得す​るにはどうすればよい​ですか?

2 views (last 30 days)
MathWorks Support Team
MathWorks Support Team on 4 Sep 2018
下記のように、Figure 上にグラフィックスを表示しています。
mesh(peaks(50));
ここで、Figure に表示されているグラフィックスを行列(データ)として取得する方法を教えてください。

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 4 Sep 2018
MATLAB の getframe 関数と frame2im 関数を使って行うことができます。
F = getframe(gcf); % フレームとして取得
[X,map] = frame2im(F); % イメージデータに変換
なお、フレーム(F)がトゥルーカラーを含む場合には、map は空となります。

More Answers (0)

Categories

Find more on 印刷と保存 in Help Center and File Exchange

Tags

No tags entered yet.

Products


Release

R2008a

Community Treasure Hunt

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

Start Hunting!