フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

structure conversion

1 回表示 (過去 30 日間)
Ahmed Tawfeeq
Ahmed Tawfeeq 2012 年 3 月 16 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
hi...how can I convert an array to structure?
MERGED from double post [16 Mar 2012, 20:44 GMT - OK]
hi...how can I convert an array of values back to it's structure form , (I read the original structure from the simulink , squeezed it ,and processed it in mfile), and now I want it back to simulink by using From Workspace block but it objects because it need the data read in sturcture form.....does it need producing singleton dimensions?

回答 (1 件)

Daniel Shub
Daniel Shub 2012 年 3 月 16 日
Is this what you mean?
x = 1:3;
x.x = x;
or maybe I should be kinder about the variable names ...
a = 1:3;
b.c = a;
  2 件のコメント
Jan
Jan 2012 年 3 月 16 日
I get a warning for the first case in 2009a:
??? Warning: Struct field assignment overwrites a value with class "double"
Daniel Shub
Daniel Shub 2012 年 3 月 16 日
I get the same warning. It still works (at least in 2011a). This is apparently a class change that MATLAB does not like. I think it probably causes the parser problems.

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by