Matlab 错误:尝试引用非结构数组的字段。图形用户界面

Matlab 错误:尝试引用非结构数组的字段。图形用户界面,matlab,user-interface,reference,Matlab,User Interface,Reference,我只有在运行archive.fig时出错。当程序运行.m没有任何问题时,我在一些网站上搜索了一下,但什么都没有。谢谢 错误: 我的代码: 请帮帮我。您不能运行.fig文件;您需要使用.m文件。看看这里:对,但是我的代码调用一个.fig文件并运行。我用这行代码回叫:`openfig'file.fig``只有当archive.fig包含矩阵时才会出现错误。哦,好吧,我很抱歉,我误解了你的问题! Attempt to reference field of non-structure array. E

我只有在运行archive.fig时出错。当程序运行.m没有任何问题时,我在一些网站上搜索了一下,但什么都没有。谢谢

错误:

我的代码:


请帮帮我。

您不能运行.fig文件;您需要使用.m文件。看看这里:对,但是我的代码调用一个.fig文件并运行。我用这行代码回叫:`openfig'file.fig``只有当archive.fig包含矩阵时才会出现错误。哦,好吧,我很抱歉,我误解了你的问题!
Attempt to reference field of non-structure array.

Error in Cramer>pushbutton2_Callback (line 128)
n = str2double(get(handles.edit1,'String'));

Error in gui_mainfcn (line 95)
        feval(varargin{:});

Error in Cramer (line 42)
    gui_mainfcn(gui_State, varargin{:});

Error in @(hObject,eventdata)Cramer('pushbutton2_Callback',hObject,eventdata,guidata(hObject))


Error while evaluating UIControl Callback
function pushbutton2_Callback(hObject, eventdata, handles)

n = str2double(get(handles.edit1,'String'));

num = cell(n,n);
num(:,:) = {''};
set(handles.uitable1,'Data',num);
set(handles.uitable1,'ColumnEditable',true());

num = cell(n,1);
num(:,:)={''};
set(handles.uitable2,'Data',num);
set(handles.uitable2,'ColumnEditable',true());