UNEMPTY

Versión 1.0.0.0 (1,56 KB) por Andreas
Sets empty fields in a structure to a defined value.
854 Descargas
Actualizado 23 mar 2005

Ver licencia

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

Citar como

Andreas (2026). UNEMPTY (https://es.mathworks.com/matlabcentral/fileexchange/7223-unempty), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R12.1
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre Structures en Help Center y MATLAB Answers.
Versión Publicado Notas de la versión
1.0.0.0