我在玩 Matlab 的 App 设计器,在很多方面它似乎是一个比 GUIDE 更好的开发工具。在放置了几个组件并进行了一些编码之后,我决定再添加一个组件,Matlab 抱怨它。
例如,什么都不做,只添加一个label
组件并运行应用程序,它会返回:
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。
这是该应用程序的屏幕截图: