StructSearch(input_​struct,search_term)

searches and returns details and child struct with matching parameters.
27 descargas
Actualizado 27 abr 2018

Ver licencia

Input:
1.struct (Nested)
2. search string(Case insensitive) to find a member.
Output:
1.Results: [nx4 string] -> [matching_member full_path_of_that_member Class_of_member Description_of_member ]
2.Child_struct= A struct formed with the matching members while preserving the hierarchy.
Application: Useful for nested struct with large number of members. I used it is for MRI data processing.
Eg:
%Example nested struct
P_struct=struct('array_small',[5 6],'array_large',ones(2,3,5),'string', 'Example');
P_struct.N1_strct=struct('string', 'Nested struct 1');
P_struct.N1_strct.N2_struct=struct('string', 'In Nested struct 2');
%Usage
[details, child]=StructSearch(P_struct,'strin');
%output
details =
3×4 string array
"string" "P_struct.string" "char" "Example"
"string" "P_struct.N1_strct.st…" "char" "Nested struct 1"
"string" "P_struct.N1_strct.N2…" "char" "In Nested struct 2"

child =
struct with fields:
string: 'Example'
N1_strct: [1×1 struct]

Citar como

Praveen Iyyappan Valsala (2024). StructSearch(input_struct,search_term) (https://www.mathworks.com/matlabcentral/fileexchange/67096-structsearch-input_struct-search_term), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2017b
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.

Community Treasure Hunt

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

Start Hunting!
Versión Publicado Notas de la versión
1.2.0.0

Forgot to upload updated file:P

1.1.0.0

1. Input arguments error handling

1.0.0.0