我有一个 Matlab .fig 文件。 (基本上是 pcolor 图)。我想从此图像中提取矩阵(如行和列到数组变量中)。我该怎么做呢?感谢您的任何输入或指示。
最佳答案
轴有一个子对象,它是一个 surface
类型的对象如果您使用了 pcolor
函数,或者类型为 image
如果您使用了 image
函数。矩阵位于此对象的 CData
属性中:
>> x = magic(3) % example data
x =
8 1 6
3 5 7
4 9 2
>> pcolor(x) % generate image
>> get(get(gca,'Children'),'CData') % retrieve the data
ans =
8 1 6
3 5 7
4 9 2
关于image - 如何在 Matlab 中从 .fig 中提取矩阵?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43553205/