Object Data get lost between save and load
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(2 个)
Prabhan Purwar
2020-4-23
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):
Thanks
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!