How do I solve this: Warning: Variable 'output' originally saved as a ProcResultClass cannot be instantiated as an object and will be read in as a uint32. ?

I have been struggling a lot trying to extract the data from a file that was exported from Homer3 with the appearance of the warning in the title each time I attempt to load the file. I understand that there is an issue regarding the class definition which I have found.
ProcResultClass with properties:
dod: [1×1 DataClass]
dc: [1×1 DataClass]
dodAvg: []
dcAvg: [1×1 DataClass]
dodAvgStd: []
dcAvgStd: [1×1 DataClass]
dodSum2: []
dcSum2: [1×1 DataClass]
tHRF: []
nTrials: {[12]}
ch: []
grpAvgPass: []
misc: [1×1 struct]
However, I am still unable to solve this issue and thus am unable to retrieve my data with much headache.
It would be very kind if someone could help me out here!
Thank you for reading!

 Accepted Answer

If the class definition is not in scope when you load the object from the MAT-file, MATLAB doesn't know how to turn the saved data back into an instance of the object. Make sure that ProcResultClass.m is available to MATLAB (in a directory on the search path or in the current directory) when you call load.

4 Comments

Hi Steven, thanks so much for your input. I have tried to create the ProcResultClass.m file. However, it appears that I am doing something wrong with the class definition and I can't seem to figure it out (code attached). Would really appreciate any help! Thank you for reading!
classdef ProcResultClass
properties
dod= [1 1]
dc= [1 1]
dodAvg= []
dcAvg= [1 1]
dodAvgStd= []
dcAvgStd= [1 1]
dodSum2= []
dcSum2= [1 1]
tHRF= []
nTrials= {[12]}
ch= []
grpAvgPass= []
misc= [1 1]
end
end
These are the errors that I am receiving:
Warning: Cannot load an object of class 'DataClass':
Its class cannot be found.
Warning: Cannot load an object of class 'DataClass':
Its class cannot be found.
Warning: Cannot load an object of class 'DataClass':
Its class cannot be found.
Warning: Cannot load an object of class 'DataClass':
Its class cannot be found.
Warning: Cannot load an object of class 'DataClass':
Its class cannot be found.
Warning: Cannot load an object of class 'DataClass':
Its class cannot be found.
Warning: Cannot load an object of class 'DataClass':
Its class cannot be found.
Warning: Cannot load an object of class 'DataClass':
Its class cannot be found.
Warning: Cannot load an object of class 'DataClass':
Its class cannot be found.
Warning: Cannot load an object of class 'DataClass':
Its class cannot be found.
Warning: Cannot load an object of class 'Logger':
Its class cannot be found.
I suspect that the definition you wrote does not match the definition that was used to create the object initially. Try adding that File Exchange submission to your MATLAB installation using Add-Ons Explorer and then try loading the MAT-file again.
Dear nehohmee & Steven,
It seems that I occurred a similar problem.
I've tried copy a ProcResultClass.m from homor3 and make it be available to MATLAB (in a directory on the search path or in the current directory) when I call load.
Then it shows this error.
I have seen that Steven said that it could be solved by adding File Exchange submission to set path.
I tried several ones on File Exchange, but it couldn't work.
May I ask which toolbox did you recomand or used?
Sincerely,
Amanda Chiu

Sign in to comment.

More Answers (0)

Products

Asked:

on 21 Dec 2022

Commented:

on 12 Dec 2023

Community Treasure Hunt

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

Start Hunting!