【问题标题】:sharing images between two matlab figures guide在两个 matlab 人物指南之间共享图像
【发布时间】:2013-06-25 14:47:46
【问题描述】:

所以问题是我在一个图形“fig1”中有 5 个图像,我想将第二个图形“fig2”发送到当我按下按钮 fig2 时,“fig2”也被 fig1 中的按钮打开应该在加载图像的情况下打开 fig2 但是当打开 fig2 时轴是空的,而如果我自己启动 fig2 它将打开加载到上一个图 fig1 的图像 代码

-用于分享图片:

在图1中:

setappdata(0,'reimage1',original_image);

setappdata(0,'reimage2',image1);

setappdata(0,'reimage3',image2);

setappdata(0,'reimage4',image3);

setappdata(0,'reimage5',image4);

在图2中:

image1 = getappdata(0,'reimage1');

axes(handles.axes1);

imshow(image1)

image2 = getappdata(0,'reimage2');

axes(handles.axes2);

imshow(image2,[])

image3 = getappdata(0,'reimage3');

axes(handles.axes3);

imshow(image3,[])

image4 = getappdata(0,'reimage4');

axes(handles.axes4);

imshow(image4,[])

image5 = getappdata(0,'reimage5');

axes(handles.axes5);

imshow(image5,[])

图1中打开第二个图的按钮代码也很简单

openfig('fig2.fig')

【问题讨论】:

    标签: matlab matlab-guide


    【解决方案1】:

    您是否尝试在调用 imshow 期间显式设置父级?

    例如:

    imshow(image5, [], 'Parent', handles.axes5)
    

    【讨论】:

      猜你喜欢
      • 2012-08-03
      • 2018-09-15
      • 2013-01-02
      • 2021-03-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-06
      • 1970-01-01
      相关资源
      最近更新 更多