c code on the Matlab function is used on plecs c script all it brought in error. On what code the plecs c script functions should be based? Is it C or C ++ and why is it that a code that runs on Matlab will give different errors inside the plecs c script block?
The PLECS C-Script block is C based. There are several means to call C code from Matlab, so perhaps you could clarify which approach you are using in Matlab and an example of the code you are using in PLECS.
All of the Matlab blocks operate differently compared to the PLECS C-Script block, for example different interface approaches and built in macros, so I would not expect one to directly copy/paste the interface code between the two programs.