Struct array conversion

バージョン 1.0.0.0 (27.8 KB) 作成者: Ged Ridgway
Convert in either direction between struct-array and structure of arrays
ダウンロード: 1K
更新 2010/3/30

ライセンスの表示

Usage: new = struct2struct(old)

If 'old' is a scalar struct containing arrays (each with the same number of rows, N) then 'new' will be an N-by-1 struct-array whose fields have a single row.

If 'old' is an N-by-1 struct-array whose fields have a single row (e.g. as returned above) then 'new' will be a scalar structure whose fields have N rows.

Either representation can have advantages for representing basic spreadsheet or database information.

A struct of arrays allows fields to be added and removed more easily and eases computation of filtering or sorting indices.
(A struct of arrays is also the format returned from csv2struct.)

A struct-array makes it easier to apply filtering and sorting operations using the computed indices/indicators.

引用

Ged Ridgway (2026). Struct array conversion (https://jp.mathworks.com/matlabcentral/fileexchange/27121-struct-array-conversion), MATLAB Central File Exchange. 取得日: .

MATLAB リリースの互換性
作成: R14SP3
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersData Types についてさらに検索
タグ タグを追加
謝辞

ヒントを得たファイル: csv2struct(filename)

struct_array_conversion/

バージョン 公開済み リリース ノート
1.0.0.0