keepfield
バージョン 1.0.0.0 (1.4 KB) 作成者:
Brett Shoelson
Keep specified fields of a structure, discarding other fields.
ML provides a useful function RMFIELD to remove specified field(s) from a structure, but no corresponding function to KEEP specified field(s), removing the rest. This function addresses that discrepancy.
ex.:
a = dir('*.m');
b = keepfield(a,{'name','date'});
This is an exceptionally short but useful piece of code.
引用
Brett Shoelson (2024). keepfield (https://www.mathworks.com/matlabcentral/fileexchange/7031-keepfield), MATLAB Central File Exchange. 取得済み .
MATLAB リリースの互換性
作成:
R14SP1
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linuxカテゴリ
Help Center および MATLAB Answers で Structures についてさらに検索
タグ
謝辞
ヒントを得たファイル: keep
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!バージョン | 公開済み | リリース ノート | |
---|---|---|---|
1.0.0.0 |