フィルターのクリア

Structure in simulink and Embedded MATLAB Function

2 ビュー (過去 30 日間)
Julio
Julio 2012 年 3 月 9 日
Hi everyone.
I'm trying prove a example of Mathworks about structure in Simulink , You can find It in the help of Matlab "Example of Structures in an Embedded MATLAB Function Block".
I do this exercise how you can look at the picture bellow( click on link bellow)
In that case , it work , but when I change "a2" with a matrix for example [2 3;4 6] and I changed the code too, look at the picture (click on link bellow)
in that case it doesn't work , appears a error window :
I hope You can help me

採用された回答

Kaustubha Govind
Kaustubha Govind 2012 年 3 月 9 日
Are you working with the demo model named 'emldemo_bus_struct'? If yes, what version are you using? I'm asking because in R2011b, it appears that the model already uses a 2x2 matrix for that last element of the bus. In any case, it seems like you may not have updated the Simulink.Bus in the base workspace to also use a 2x2 matrix. You need to look at the "Output Data Type" setting in the dialog of the Bus Selector that the bottom two Constant blocks are connected to. You will see a Simulink.Bus object with the same object. If it's called SubBus:
>> busEls = SubBus.Elements;
>> busEls(2)
ans =
Simulink.BusElement
Name: 'a2'
Complexity: 'real'
Dimensions: [2 2]
DataType: 'int8'
Min: []
Max: []
DimensionsMode: 'Fixed'
SamplingMode: 'Sample based'
SampleTime: -1
See that the "Dimensions" field says "[2 2]".

その他の回答 (1 件)

Julio
Julio 2012 年 3 月 9 日
Thank you for answer me ... I didn't use the demo , simply I created a new model (a copy) , you are right the problem is the dimension field , I dont knowed it , I though that it was automatic ... Now it work very good, thank you very much :).
  2 件のコメント
Kaustubha Govind
Kaustubha Govind 2012 年 3 月 12 日
Julio: Could you please accept my answer if your question is resolved? Thanks!
Julio
Julio 2012 年 3 月 28 日
Sorry , I forgot It.
Thank again .

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

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by