Dot indexing is not supported for variables of this type
5 次查看(过去 30 天)
显示 更早的评论
Hello Everyone,
I am trying to implement a new stand alone function to load a mat file (which has 3 timeseries in it) : (for example: Data.Signal1.Data,) and plot it.
The App is functional within Matlab app designer, but when i build a stand alone application, this error occured:
Dot indexing is not supported for variables of this type.
Unfortunatly i can not find the solution for that. could you please help me about it?
properties (Access = public)
DataMeas = struct; % Description
end
% Button pushed function: OpenCalcmFile
function OpenCalcmFileButtonPushed(app, event)
[file,path] = uigetfile();
if isequal(file,0)
app.CalcmFilePath.Value = "";
else
app.CalcmFilePath.Value = append(path,file);
app.DataMeas = load(append(path,file));
end
function OpenMatFileButtonPushed(app, event)
plot(app.Plot_graph1,app.DataMeas.signal1.Data);
end
Error in log:
Dot indexing is not supported for variables of this type.
Error in TestAutomation/OpenMatFileButtonPushed (line 766)
Error in appdesigner.internal.service.AppManagementService/tryCallback (line 368)
Error in matlab.apps.AppBase>@(source,event)tryCallback(appdesigner.internal.service.AppManagementService.instance(),app,callback,requiresEventData,event) (line 37)
Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback (line 386)
Error while evaluating Button PrivateButtonPushedFcn.
0 个评论
回答(1 个)
Steven Lord
2024-5-10
If you are attempting to compile code using MATLAB Compiler that calls load to load an object from a MAT-file and there is no indication in the code itself that MATLAB Compiler needs to package the code, the dependency analyzer may not be able to detect that it needs to include the definition of the class. In this case use one of the workarounds in the "Callback Problems Due to Missing Functions" section of this documentation page, as this workflow is described by the Tip in that section of that documentation page.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Entering Commands 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!