Image 将使用MATLAB填充函数创建的图像存储到变量中

Image 将使用MATLAB填充函数创建的图像存储到变量中,image,matlab,variables,Image,Matlab,Variables,如何将使用MATLAB fill()函数创建的图像存储到变量中,以便在代码中进一步使用它 My fill()函数: axis ( [ 0, 1, 0, 1 ] ) x1 = [ 0.0, 0.5, 0.5 ]; y1 = [ 0.5, 0.5, 1.0 ]; fill ( x1, y1, 'r' ) 谢谢你的帮助 假设您没有图像处理工具箱(在这种情况下,使用直接生成图像可能是更好的选择),这可能是最好的方法 引用文档中的示例代码: f = getframe; %Cap

如何将使用MATLAB fill()函数创建的图像存储到变量中,以便在代码中进一步使用它

My fill()函数:

axis ( [ 0, 1, 0, 1 ] )
x1 = [ 0.0, 0.5, 0.5 ];
y1 = [ 0.5, 0.5, 1.0 ];
fill ( x1, y1, 'r' )

谢谢你的帮助

假设您没有图像处理工具箱(在这种情况下,使用直接生成图像可能是更好的选择),这可能是最好的方法

引用文档中的示例代码:

f = getframe;              %Capture screen shot
[im,map] = frame2im(f);    %Return associated image data 
if isempty(map)            %Truecolor system
  rgb = im;
else                       %Indexed system
  rgb = ind2rgb(im,map);   %Convert image data
end

使用saveas然后使用imread?