Reshape 1x2 struct to 1x1 stuct where dimension doesn't match.

3 ビュー (過去 30 日間)
maxmathlab
maxmathlab 2017 年 1 月 3 日
コメント済み: maxmathlab 2017 年 1 月 3 日
I have a 1x2 stuct with 27 fields.
E.g. I can't plot A cause the dimensions of A(1,1) and A(1,2) don't match. All the values are doubles. And I would like to make it a 1x1 struct so I can work with it. I combined 2 single structs to get this 1x2 struct if this helps.
Any tipps, help??
  2 件のコメント
José-Luis
José-Luis 2017 年 1 月 3 日
They don't match. What do you want to do about it? Concatenate?
maxmathlab
maxmathlab 2017 年 1 月 3 日
lets say in A(1,1) there are doubles from 1 to 672618 and in A(1,2) from 672619 to 929139. How can I make 1 field from 1 to 929139 instead?

サインインしてコメントする。

採用された回答

José-Luis
José-Luis 2017 年 1 月 3 日
your_field = [A(1,1); A(1,2)];
  8 件のコメント
José-Luis
José-Luis 2017 年 1 月 3 日
That's a different question. Here goes:
bla = struct('a',1,'b',2:5,'c',3)
fields = fieldnames(bla)
for i=1:numel(fields)
bla.(fields{i})
end
maxmathlab
maxmathlab 2017 年 1 月 3 日
stephen I know thats bad. But I am in the stage of ordering my Data before working with it. and I don't know any other solution to sort it.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStructures についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by