# Please I need this on c-script

**URL:** <https://forum.plexim.com/t/please-i-need-this-on-c-script/1297>\
**Category:** PLECS\
**Tags:** c, c-script\
**Created:** [December 6, 2023, 2:18am UTC](https://forum.plexim.com/t/please-i-need-this-on-c-script/1297 "2023-12-06T02:18:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Awesome](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@Awesome](https://forum.plexim.com/u/Awesome)\
**Post date:** [December 6, 2023, 2:18am UTC](https://forum.plexim.com/t/please-i-need-this-on-c-script/1297/1 "2023-12-06T02:18:03Z")

</div>

Please I need this function on plecs c script, please I did not get it. Here it is

function [ma, mb] = fcn(u, t, theta, f)

ma = u_sin(2_pi_f_t+(theta\*pi/180));

mb = u_sin(2_pi_f_t+pi+(theta\*pi/180));

 ![matlab function.JPG](https://europe1.discourse-cdn.com/flex006/uploads/plecs/original/2X/b/b1591c7b560c785a3481d07021a79c4fb86b0926.jpeg)

---

<div class="post-metadata">

**Author:** ![Bryan\_Lieblick](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.plexim.com/bryan_lieblick/32/10_2.png) [@Bryan\_Lieblick](https://forum.plexim.com/u/Bryan_Lieblick)\
**Post date:** [December 6, 2023, 1:33pm UTC](https://forum.plexim.com/t/please-i-need-this-on-c-script/1297/2 "2023-12-06T13:33:48Z")

</div>

Rather than use a C-Script, I would recommend implementing this using basic blocks from the PLECS Component Library.

You can use the Trigonometric Function, Gain or Product, and Sum blocks. The “Function” block would also be suitable as it allows you to “Apply arbitrary arithmetic expression to scalar or vectorized input signal”.
