Turn a MATLAB plot into image

后端 未结 2 1518
生来不讨喜
生来不讨喜 2020-12-02 00:31

I have generated a plot like

figure; hold;
axis([0 10 0 10]);
fill([ 1 1 5 5], [5 1 1 5],\'b\')

and now I want to have this plot as an matr

2条回答
  •  抹茶落季
    2020-12-02 01:21

    You can use GETFRAME function. It returns movie frame structure, which is actually rasterized figure. Field cdata will contain your matrix.

    F=getframe;
    figure(2)
    imagesc(F.cdata);
    

提交回复
热议问题