UNEMPTY

버전 1.0.0.0 (1.56 KB) 작성자: Andreas
Sets empty fields in a structure to a defined value.
다운로드 수: 854
업데이트 날짜: 2005/3/23

라이선스 보기

This function is useful if numeric values from a structure array are to be extracted using the notion M = S.field] UNEMPTY makes sure that empty matrices in the structure do not affect the size of M.

S = unempty(C) sets all occurences of empty matrices in all fields of C to NaN.

[S,nc] = unempty(C) reports the number of changed fields in nc.

S=unempty(C,F) sets in a structure array all occurences of empty matrices for field F to NaN.

S=unempty(C,F,value) sets all occurences of empty fields to value.

Example:

S=[struct('f',1) struct('f',2) struct('f',[]) ];
disp([S.f]) % size is different from S
1 2
S = unempty(S);
disp([S.f]) % size is the same as S
1 2 NaN

인용 양식

Andreas (2024). UNEMPTY (https://www.mathworks.com/matlabcentral/fileexchange/7223-unempty), MATLAB Central File Exchange. 검색됨 .

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