MATLAB: How can i define sind, cosd etc. in SIMULINK
MATLABsimulink
Hi,
In SIMULINK, we can convert the angle from radian to degree, but there is no block about sind, cosd or atand. Why does not SIMULINK include them and is there any way to define this kind of functions?
Thanks
Best Answer
Sure you can define them. You can create MATLAB Function Blocks. Or use Gain blocks. You could probably even create Subsystems if you want them to appear to be library blocks. Or even define Level-2 S functions if you are really enthusiastic about presentation and controls.
Do you need this to be MATLAB code? If so, you can use aMATLAB Function block in the Simulink --> Ports & Subsystems Library and type your own MATLAB code in there.
If you want the Simulink block approach, you can use a Saturation block to limit the angle signal and then convert it to radians with a Gain block set to pi/180.
Best Answer