Info

This question is closed. Reopen it to edit or answer.

How to change variabels in simulink?

1 view (last 30 days)
Espen Olsen
Espen Olsen on 16 Apr 2015
Closed: MATLAB Answer Bot on 20 Aug 2021
Hi!
My case is this, I want to create a relay with different ON/OFF values.
I would like there to be 2 variabels that is named ON and OFF and have them update the relay values if certian conditions are true. For exampel.
If x > 0 ON=1; OFF=0; (the values for relay are now ON 1 and OFF 0)
elseif x < 0 ON = 2; OFF =-1; (the values for relay are now ON 2 and OFF -1) end
Is there any way to do this? I have tried to use to Matlab Function block but I have not been able to declare variabel here that I can use in my relay.
Thanks for any reply.

Answers (0)

Community Treasure Hunt

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

Start Hunting!