keepfield

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 (2026). keepfield (https://jp.mathworks.com/matlabcentral/fileexchange/7031-keepfield), MATLAB Central File Exchange. に取得済み.

謝辞

ヒントを得たファイル: keep

カテゴリ

Help Center および MATLAB AnswersStructures についてさらに検索

一般的な情報

MATLAB リリースの互換性

  • すべてのリリースと互換性あり

プラットフォームの互換性

  • Windows
  • macOS
  • Linux
バージョン 公開済み リリース ノート Action
1.0.0.0