![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/286989/image.png)
Object Data get lost between save and load
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I want to save an object in a *.mat file and load it at a later point. Before I save it there is data in the object data property, when I load it there is no data in it. If I run this code
info1 = 'these are the properties that will be saved'
tmtable = app.FlightMatrixTable % to be saved
save('FMtestmatrix.mat','tmtable'); % saving it according to MATLAB Syntax
load('FMtestmatrix.mat'); % loading it without anything modified on tmtable between save and load
info2 = 'this is how it comes out of the mat file'
tmtable
this is the output shown in my command window:
info1 =
'these are the properties that will be saved'
tmtable =
Table with properties:
Data: [8×8 table]
ColumnWidth: 'auto'
ColumnEditable: []
CellEditCallback: ''
Position: [18 51 669 429]
Units: 'pixels'
Show all properties
info2 =
'this is how it comes out of the mat file'
tmtable =
Table with properties:
Data: []
ColumnWidth: 'auto'
ColumnEditable: []
CellEditCallback: ''
Position: [18 51 669 429]
Units: 'pixels'
Show all properties
As you can see the Data property contains an 8x8 table before saving and is empty after loading. What happened inbetween saving and loading? Thank you very much for your help!
0 Commenti
Risposte (2)
Prabhan Purwar
il 23 Apr 2020
Hi,
Could you please provide the app.FlightMatrixTable object so that we can replicate the issue.
Kindly refer to the following code:
info1 = 'these are the properties that will be saved'
pcobj=pointCloud([0 0 0])
save('FMtestmatrix.mat','pcobj'); % saving it according to MATLAB Syntax
load('FMtestmatrix.mat'); % loading it without anything modified on pcobj between save and load
info2 = 'this is how it comes out of the mat file'
pcobj
Output (as expected):
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/286989/image.png)
Thanks
0 Commenti
Vedere anche
Categorie
Scopri di più su Low-Level File I/O in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!