In Simulink, is it possible to write a user-defined function that has multiple arguments?
I want to create a block that does a mathematical operation on multiple arguments. This is easy to do in the case of one argument: just create a "user-defined function" that takes in u and ouputs y. However, I want it to take in multiple values, for instance p, q, and r, and output y. My function would be something like y=cos(p)+1/(sin(q)+exp(r)). Can this be done?
Answer:
Simulink...it's been a little while but let me give it a shot. I believe you have to start with a sum block and have any amount of variable blocks inputing as you want. Just make sure that you variables defined somewhere in the ramp so they are inputed.
If that doesnt work you can try to break each part up, solve them independently and input them into a sum block at the end. That way they alreay have vaules assumes and you are simply doing the simple math.
Give those a try and see what you come up with.
I've seen it done before. It uses inputs u1, u2, u3 etc. But I don't have simulink on this machine.
More Questions and Answers:
What is action stop valve in the steam turbin?
Can you interrupt cell phone signals in your home on purpose?
What is wall thickness in mm for 12 inch x sch120 pipe?
I have just cleared my 12th with 35% and want to do engineering in automobile are their any chances?
What are the duties of project engg?
Definition and 5 examples of information technology, medical technology and assistive technology?
High Voltage Power Lines?
I want a tag line for my technical event which is a final 3 day fest?
What can we analysis for the stress strain curve for compressing a material?
My air in aieee is 36055,which college will i get for admission?
Answer:
Simulink...it's been a little while but let me give it a shot. I believe you have to start with a sum block and have any amount of variable blocks inputing as you want. Just make sure that you variables defined somewhere in the ramp so they are inputed.
If that doesnt work you can try to break each part up, solve them independently and input them into a sum block at the end. That way they alreay have vaules assumes and you are simply doing the simple math.
Give those a try and see what you come up with.
I've seen it done before. It uses inputs u1, u2, u3 etc. But I don't have simulink on this machine.
The answers post by the user, for information only, FunQA.com does not guarantee the right.
More Questions and Answers: