StructSearch(input_​struct,search_term)

searches and returns details and child struct with matching parameters.
ダウンロード: 27
更新 2018/4/27

ライセンスの表示

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]

引用

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. 取得済み .

MATLAB リリースの互換性
作成: R2017b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersStructures についてさらに検索

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.2.0.0

Forgot to upload updated file:P

1.1.0.0

1. Input arguments error handling

1.0.0.0