简体   繁体   中英

imagesc plot to matrix in matlab

I would like to save in a matrix the plot that imagesc returns. How can I do that? All I know that imagesc returns a handle and I don't know what to do with it.

The data for imagesc is stored in the CData property, so use this to extract it:

X = get(h, 'CData');

assuming h is your handle.

Now X contains your image data, and you can save it to a file, for instance:

save somefile.mat X

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM