emptyStruct

版本 1.0.0.0 (1.6 KB) 作者: David Young
Creates empty struct arrays of various kinds
412.0 次下载
更新时间 2014/1/20

查看许可证

There are various different ways a structure array S can count as empty:

S has one or more zero numerical dimensions, but has some fields. (SIZE(S) contains at least one zero.) In this case, ISEMPTY(S) returns true.

S has no fields, but all of its numerical dimensions are positive. (SIZE(S) contains no zeros.) In this case ISEMPTY(S) returns false, but the array is empty in the sense of having zero fields and hence no contents.

S has no fields and at least one zero in its size.

S has fields and a non-zero size, but every element is an empty matrix. Strictly, S is not empty, in that the empty matrices are its contents, but this is sometimes a useful structure to create.

Each of the above kinds of "empty" structure arrays can be useful as initializations. They can all be created using STRUCT, but it is not always obvious how to do it simply. This function provides a straightforward way to create these different kinds of structure arrays.

引用格式

David Young (2024). emptyStruct (https://www.mathworks.com/matlabcentral/fileexchange/45135-emptystruct), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2013b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Structures 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0.0