I am compiling MATLAB code which loads a Dataset object from a MAT file. For example, I have generated a MAT file using the following code:
NumObs = 5;NameObs = strcat({'Obs'},num2str((1:NumObs)','%-d'));meas = [ ... 5.1 3.5 1.4 0.2 4.9 3 1.4 0.2 4.7 3.2 1.3 0.2 4.6 3.1 1.5 0.2 5 3.6 1.4 0.2];iris = dataset({nominal(repmat({'setosa'},NumObs,1)),'species'},... {meas,'SL','SW','PL','PW'},... 'ObsNames',NameObs);display(iris);save iris
And I have compiled the below code which loads a dataset object, as saved
function testloadload irisdisplay(iris.SW('Obs1'));
However, I receive the following error when executing my compiled application.
Warning: Variable 'iris' originally saved as a dataset cannot be instantiated
as an object and will be read in as a uint32.
> In testload at 3
??? Attempt to reference field of non-structure array.
Error in ==> testload at 4
Best Answer