structure conversion

1 次查看(过去 30 天)
Ahmed Tawfeeq
Ahmed Tawfeeq 2012-2-25
hi...how can I convert a structure produced from matlab simulink into another datatype(double for example)such that I can use it into another function?

采纳的回答

Jiro Doke
Jiro Doke 2012-2-25
Functions can take structures (created from Simulink or elsewhere). It depends on which function you're trying to call. That determines what the input should be. A structure is just a collection of data that may contain other types of data. Type the name of the structure into the Command Window to see what's inside. You can grab the data inside by accessing the fields, e.g.
aStruct.thisField
  5 个评论
Jiro Doke
Jiro Doke 2012-2-27
Take a look at the command "squeeze".
data = squeeze(ahmed.signals.values);
That will give you 30000x5 double. Now, depending on which column you want, you can type something like data(:, 1)
Ahmed Tawfeeq
Ahmed Tawfeeq 2012-3-4
thanks.....I appreciate your help.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Whos 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by