Matlab 应用程序设计器:不存在 public 属性 [x]
Matlab App designer: No public property [x] exists
我正在使用 Matlab 的 App designer,它在许多方面似乎是比 GUIDE 更好的开发工具。在放置了几个组件并进行了一些编码之后,我决定再添加一个组件,而 Matlab 对此提出了抱怨。
例如,什么都不做,只添加一个 label
组件和 运行 应用程序,它 returns:
No public property Label3 exists for class UTPPP.
Error in UTPPP (line 188)
createComponents(app)
错误标记位于第 177 行:
% App initialization and construction
methods (Access = private)
% Create UIFigure and components
function createComponents(app)
% Create UIFigure
app.UIFigure = uifigure;
......
% Create Label3
app.Label3 = uilabel(app.Tab); %<-----------Line 177
app.Label3.Position = [892 547 31 15];
app.Label3.Text = 'I''m the newly added label';
end
end
显然,存在 Label3
个 属性:
% Properties that correspond to app components
properties (Access = public)
UIFigure matlab.ui.Figure % Ultrasonic pr...
......
Label3 matlab.ui.control.Label % I'm the newly...
end
对于我要放置的任何组件,都会显示类似的错误消息。删除组件也会删除此类错误消息。
有人运行遇到过这种问题吗?我不知道我可能做错了什么;这可能是一个错误。我正在使用 Matlab R2016a。
这是应用程序的屏幕截图:
好吧,既然没有人想出答案...
这是 MATLAB 2016a 中的错误。该错误的原因未知,即使它在我身上发生过多次,我也不知道如何复制它。
解决方法很简单:
重新启动 MATLAB。
我正在使用 Matlab 的 App designer,它在许多方面似乎是比 GUIDE 更好的开发工具。在放置了几个组件并进行了一些编码之后,我决定再添加一个组件,而 Matlab 对此提出了抱怨。
例如,什么都不做,只添加一个 label
组件和 运行 应用程序,它 returns:
No public property Label3 exists for class UTPPP. Error in UTPPP (line 188) createComponents(app)
错误标记位于第 177 行:
% App initialization and construction
methods (Access = private)
% Create UIFigure and components
function createComponents(app)
% Create UIFigure
app.UIFigure = uifigure;
......
% Create Label3
app.Label3 = uilabel(app.Tab); %<-----------Line 177
app.Label3.Position = [892 547 31 15];
app.Label3.Text = 'I''m the newly added label';
end
end
显然,存在 Label3
个 属性:
% Properties that correspond to app components
properties (Access = public)
UIFigure matlab.ui.Figure % Ultrasonic pr...
......
Label3 matlab.ui.control.Label % I'm the newly...
end
对于我要放置的任何组件,都会显示类似的错误消息。删除组件也会删除此类错误消息。
有人运行遇到过这种问题吗?我不知道我可能做错了什么;这可能是一个错误。我正在使用 Matlab R2016a。
这是应用程序的屏幕截图:
好吧,既然没有人想出答案...
这是 MATLAB 2016a 中的错误。该错误的原因未知,即使它在我身上发生过多次,我也不知道如何复制它。
解决方法很简单:
重新启动 MATLAB。