在MATLAB中将imagesc绘制到矩阵 [英] imagesc plot to matrix in matlab

查看:86
本文介绍了在MATLAB中将imagesc绘制到矩阵的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将imagesc返回的图保存在矩阵中. 我怎样才能做到这一点? 据我所知,imagesc返回一个句柄,我不知道该怎么处理.

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.

推荐答案

imagesc的数据存储在CData属性中,因此可以使用它来提取它:

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

X = get(h, 'CData');

假设h是您的句柄.

现在X包含您的图像数据,您可以将其保存到文件中,例如:

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

save somefile.mat X

这篇关于在MATLAB中将imagesc绘制到矩阵的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆