complex numbers in PLECS C-script

Hi

I tried to write a complex number in C-script.

#include

float j;

j = csqrt(-1);

It’s a code on the top for complex numbers.

what’s problem ?

PLECS C-Scripts support complex numbers. The issue is that you must define your variable as a complex number in your code declarations. For example “float complex a;”.

Attached is an example highlighting complex number usage in C-Scripts. Note if a complex number is directly used as an output signal only the real component is used. This is shown in the example.

complexScript.plecs (7.99 KB)