问题描述
我有以下问题.让我们说,我们有一些用Matlab编写的GUI.随它去mygui.fig
和mygui.m
.
I have the following problem. Let us say, we have some GUI written in Matlab. Let it be mygui.fig
and mygui.m
.
好的,现在我要重写此gui并保留其先前版本.因此,我将这两个文件复制到mygui_new.fig
和mygui_new.m
.
OK, now I want to rewrite this gui and keep prev version of it. So, I copy these two files to mygui_new.fig
and mygui_new.m
.
我们都知道,当我们运行something.fig
时,Matlab会尝试找到something.m
以便对我们的动作执行响应.但是,当我尝试运行mygui_new.m时,Matlab尝试从mygui.m中读取脚本,并向我发出如下警告:
We all know, that when we run something.fig
, Matlab tries to find something.m
in order to perform responses on our actions. However, when I'm trying to run my mygui_new.m, Matlab tries to read scripts from mygui.m giving me warnings like:
Warning: Name is nonexistent or not a directory: ..\..\matlab\PostProcess\
In path at 110
In addpath at 87
In mygui at 22
In @(hObject,eventdata)SemiSuperviseTool_main('video_name_popupmenu_CreateFcn',hObject,eventdata,guidata(hObject))
In graphics/private/hgloadStructDbl at 95
In /usr/local/MATLAB/R2013a/toolbox/matlab/graphics/hgload.p>hgload at 70
In openfig at 72
In gui_mainfcn>local_openfig at 286
In gui_mainfcn at 159
In mygui_new at 46
因此,我们看到Matlab确实是从我的新脚本版本开始的,但是由于某种原因,然后尝试加载旧的脚本.如果我完全删除旧文件,GUI将无法运行.
So, we see that Matlab is really starting from my new version of script, but then for some reason tries to load an old one. If I delete old files at all, GUI will not run.
这是我的另一篇文章:复制gui图形后没有断点吗?
Here is another my post:No breakpoints after gui figure copying?
我在那里描述的解决方案在这里不起作用.
The solutions I've described there doest not work here.
有什么想法吗?谢谢!
Any ideas?Thanks!
推荐答案
FIG文件存储具有与原始M文件相关的名称的标记和回调.因此,要真正复制,必须至少使用GUIDE编辑新FIG文件的更改.
The FIG file stores tags and callbacks that have names tied to the original M file. So, to truly replicate, one has to at least edit those changes for the new FIG file using GUIDE.
这篇关于Matlabs复制图形后运行错误的脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!