필터 지우기
필터 지우기

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개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by