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

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

问题描述

想象一下,你在一个图中绘制了几个点、圆、线.之后另一个 m 文件应该使用这个图作为输入来做例如阈值.我知道打印命令,但我不希望将绘图存储为文件.我更愿意将它存储在矩阵 (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?

推荐答案

您应该查看函数 getframeframe2im 将图形或轴对象转换为图像矩阵.

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

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

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