在Matlab中将图另存为矩阵 [英] Save a plot in Matlab as a matrix

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

问题描述

假设您在图形中绘制了多个点,圆,线.之后,另一个m文件应使用该图作为输入来执行例如阈值化.我知道print命令,但我不希望将图存储为文件.我希望将其存储在矩阵(x_dim,y_dim,3)中.有任何想法吗?

Just imagine you plot several dots, circles, lines in a figure. Afterwards another m file should use this plot as an input to do e.g. thresholding. I'm aware of the print command but I don't want the plot to be stored as file. I would prefer to store it in a matrix (x_dim,y_dim,3). Any ideas?

推荐答案

您应检出 getframe frame2im 将图形或轴对象转换为图像矩阵.

You should check out the functions getframe and frame2im to convert a figure or axes object to an image matrix.

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

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