![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/286989/image.png)
Object Data get lost between save and load
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (2)
Prabhan Purwar
el 23 de Abr. de 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 comentarios
Ver también
Categorías
Más información sobre Low-Level File I/O en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!