Can Simscape handle Arrays or Vector Data? if so, how?
Mostrar comentarios más antiguos
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
Respuestas (1)
Alex Reilly
el 13 de Nov. de 2019
0 votos
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 comentario
SRINIVAS SS
el 28 de Oct. de 2021
Hi have you got the solution for ,,if yes please let me know
Categorías
Más información sobre Creating Custom Components and Libraries en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!