Recursive version of isempty() for cells and structures

버전 1.0.0.0 (2.05 KB) 작성자: Kevin Bartlett
Returns true for cell arrays/structures that are not empty, but have only empty cells/fields.
다운로드 수: 226
업데이트 날짜: 2011/9/26

라이선스 보기

Matlab's isempty() returns false for a structured variable that contains one or more fields. In some circumstances, however, a structured variable may have been initialised with empty fields to be populated later; in this case, we might want to consider the structure to be empty if the fields themselves are empty.

isemptyr() tests for this condition by recursively checking the fields of a structured variable, returning true if only empty fields are found.

Similarly, for cell arrays, Matlab's isempty() returns false if the array contains one or more cells, even if they are empty. isemptyr(), in contrast, searches the cell array recursively, returning true if only empty cells are found.

isemptyr() works just like Matlab's isempty() for normal arrays and strings.

인용 양식

Kevin Bartlett (2025). Recursive version of isempty() for cells and structures (https://www.mathworks.com/matlabcentral/fileexchange/33030-recursive-version-of-isempty-for-cells-and-structures), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2011a
모든 릴리스와 호환
플랫폼 호환성
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