class2struct

版本 1.2.0.0 (1.4 KB) 作者: Ofek
Strip all class methods, leaving just the bare data as struct fields
54.0 次下载
更新时间 2016/9/11

查看许可证

Often one comes across the need to strip a class down to its bare data - in particular in contexts of serializing/deserializing, and working with it across external interfaces.
Matlab's built in struct(cls) doesn't suffice, as the class can have properties that are classes themselves. Hence, this small utility.
Please say if it helps you, and more importantly - if it doesn't.
Doesn't require any fancy new functionality - probably works in 2009+ versions, but I'm unable to test.

引用格式

Ofek (2026). class2struct (https://ww2.mathworks.cn/matlabcentral/fileexchange/58426-class2struct), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2016a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Data Type Conversion 的更多信息
标签 添加标签
版本 已发布 发行说明
1.2.0.0

Fixed shape of embedded cell arrays and matrices
fix name

1.1.0.0

Documentation added and warnings handled

1.0.0.0