フィルターのクリア

convert array vector in matrix

2 ビュー (過去 30 日間)
piero
piero 2023 年 6 月 24 日
回答済み: DGM 2023 年 6 月 24 日
D=Sis(i).dailyprof;
for i=1:width(Sis)
D(:,i)=Sis(i).dailyprof;
end
an i get the same result avoid loop loop? i try to use reshape but i can't

採用された回答

DGM
DGM 2023 年 6 月 24 日
Consider the example:
% a struct array with a field of column vectors
S = struct('field1',(1:10).');
S = repmat(S,10,1);
D = horzcat(S.field1) % concatenate all column vectors into one matrix
D = 10×10
1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by