Can Simscape handle Arrays or Vector Data? if so, how?

To any Matlab Expert,
I have a problem, I am trying to model two bays connected via several orifices. However, I want the user of the model to be able to set the number of orifices by using a GUI.
My question is, is it possible to put data into an array or vector while using simscape?... I have tried feeding a vector to a PS to S block but it doesnt allow it, I have also tried to vectorize my own custom component block but, if I try to vectorize the variables or Nodes I am unable to build the block using ssc_build.
My goal is to place all orifice data into an array that the user can choose the size of; for example if he chooses "4" orifices then my array would have 4 dimensions for things like orifice location and radius, however I need to be able to send this data through simscape components like Pressure Source Blocks and Flow Sensors, etc.
I hope I am making sense, please help if possible!
Thanks, Kris

回答 (1 件)

Alex Reilly
Alex Reilly 2019 年 11 月 13 日

0 投票

I'm trying to accomplish a similar task. I was able to package an array of data like this:
outputs
myOut = {zeros(1,4), '1'} m:right
end
equations
myOut(1)= x;
myOut(2) =y;
etc
end
This puts alll my data on the same pin, but I'm stuck on 'decomposing' the pin on the next block that uses that data.

1 件のコメント

SRINIVAS SS
SRINIVAS SS 2021 年 10 月 28 日
Hi have you got the solution for ,,if yes please let me know

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

カテゴリ

ヘルプ センター および File ExchangeCreating Custom Components and Libraries についてさらに検索

質問済み:

2011 年 12 月 2 日

コメント済み:

2021 年 10 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by