Please take a minute to review and accept our Terms of Use.
Welcome to the PLECS User Forum, where you can ask questions and receive answers from other members of the community.

Many technical questions regarding PLECS are answered on the Technical Solutions page of our website. Tutorial videos, specific application examples, and pre-recorded webinars are available on our YouTube page. Please follow us on LinkedIn for the latest Plexim news.

Please I need this on c-script

0 votes
223 views
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));
asked Dec 6, 2023 by Awesome (30 points)

1 Answer

+1 vote
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".
answered Dec 6, 2023 by Bryan Lieblick (1,909 points)
...