# Similar Matlab Function block?

**URL:** <https://forum.plexim.com/t/similar-matlab-function-block/449>\
**Category:** PLECS\
**Tags:** function, matlab, c-script\
**Created:** [July 3, 2018, 7:46am UTC](https://forum.plexim.com/t/similar-matlab-function-block/449 "2018-07-03T07:46:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nikilito](https://avatars.discourse-cdn.com/v4/letter/n/dfb087/32.png) [@nikilito](https://forum.plexim.com/u/nikilito)\
**Post date:** [July 3, 2018, 7:46am UTC](https://forum.plexim.com/t/similar-matlab-function-block/449/1 "2018-07-03T07:46:55Z")

</div>

Hi everyone.

In Matlab/Simulink it’s possible to write a code in a block called Matlab Function so you can manage your inputs and creates the desired outputs.

Well. First question: Is there in Plecs Standalone the similar “block” ? Is the C-Script block ?

Second question: Is this the only way to get my goal?

Thank you.

Bye.

---

<div class="post-metadata">

**Author:** ![Kris\_Eberle](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.plexim.com/kris_eberle/32/6_2.png) [@Kris\_Eberle](https://forum.plexim.com/u/Kris_Eberle)\
**Post date:** [July 24, 2018, 9:25pm UTC](https://forum.plexim.com/t/similar-matlab-function-block/449/2 "2018-07-24T21:25:45Z")

</div>

Hello,

Yes, in PLECS Standalone, the C-Script block is likely your best option. It might also be achievable using the State Machine block. Have you tried either of these?

Best,

Kris

---

<div class="post-metadata">

**Author:** ![nikilito](https://avatars.discourse-cdn.com/v4/letter/n/dfb087/32.png) [@nikilito](https://forum.plexim.com/u/nikilito)\
**Post date:** [July 25, 2018, 5:10am UTC](https://forum.plexim.com/t/similar-matlab-function-block/449/3 "2018-07-25T05:10:21Z")

</div>

Hi!

Thank you for your answer.

I tried to use C-Script but for some things is quite difficult… maybe because I don’t know very well C! 🙂

I’ll take a look at State Machine block… I didn’t know it existed!

Regards.
