How do i convert an image plot to a matrix.

38 views (last 30 days)
ronald on 21 Nov 2014
Answered: Leslie Solorzano on 16 Dec 2016
I was wondering if it was possible to create a matrix out of a figure plot.
I would be grateful for any help. Thanks.

Answers (3)

Image Analyst
Image Analyst on 21 Nov 2014
You can use export_fig

Leslie Solorzano
Leslie Solorzano on 16 Dec 2016

Ben11 on 21 Nov 2014
Maybe I misunderstood but you might want to use getframe and get the cdata property:
x = -10:10;
y = x.^2;
Frame = getframe(gcf)
FrameData = Frame.cdata; %// This is a matrix that you can plot/show with imshow.


Find more on Convert Image Type in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!