Clear Filters
Clear Filters

Dot indexing is not supported for variables of this type

16 views (last 30 days)
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.

Answers (1)

Steven Lord
Steven Lord on 10 May 2024
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.

Categories

Find more on Entering Commands in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!