parameter sweep with C-scriptvalues instead of Schematics values

Hello Guys,

how can I connect my InputSignal (0,0) im C-script with my simulationsscript? i tried it with an example illustrated down but it comes an output of 0.
It looks as if my C-script and simulation parameters were not connected.
Here instead of a circuit I have a C script and want to sweep the input parameters of my C script.

Please may somebody help me?

thanks in advance

c-script.docx (256 KB)

Please see the section User Parameters in the chapter C-Scripts in the user manual to learn how to pass MATLAB/Octave expressions (including workspace variables) into C code. The section Multiple Sample Times - Turn-on Delay further below in the same chapter presents a small example implementation.

Alternatively you could also consider using the workspace variable in a Constant block and feed its output signal into the C-Script block.