MATLAB: How to create a matrix with real and complex values in Simulink

complex numbersmatrixmultiplexorsimulink

I am trying to create the matrix representation for some Quantum gates and I am having trouble creating a matrix with complex components.
To create matrices with Real components I have been creating vectors of constant blocks with the MUX block and then concatenating MUX blocks to create a matrix. When I try to do that with a complex constant block I receive the following errors.
"Complex signal mismatch. Input port 1 of 'untitled2/Mux2' expects a signal of numeric type complex. However, it is driven by a signal of numeric type real" and "Complex signal mismatch. Output port 1 of 'untitled2/Constant4' is a signal of numeric type real. However, it is driving a signal of numeric type complex"
Is there a way to do what I am trying to do? For example create a matrix that looks like the following,
[1 0]
[0 i]
Thank you.

Best Answer

This block can be configured with a signal as the real part, and with the constant 0 as the imaginary part.
Related Question