imagesc plot to matrix in matlab

后端 未结 1 1872
予麋鹿
予麋鹿 2020-12-22 02:56

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.

相关标签:
1条回答
  • 2020-12-22 03:29

    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
    
    0 讨论(0)
提交回复
热议问题