Define a matrix of inputs in C-Script

I am trying to define many inputs (voltages in a multilevel converter) as a matrix and not one by one. Could anyone help me?

Thank you :slight_smile:

See the excerpt from the C-Script help below.

Say you have a 3x3 matrix. If Iā€™m understanding your question correctly, one could:

Set the Number of Inputs field be ā€œ9ā€. There will be one input port to the C-Script block. Access the matrix entries as InputSignal(0, 3*Row + Column)Set the Number of Inputs field be ā€œ[3, 3, 3]ā€. The C-Script will have 3 input ports, each with three elements. Access the matrix entries as InputSignal(Row,Column)