Complex Data type not accepted in Simulink I am having an issue with the interaction of the Matlab function block in the Simulink with my model block. Below you can also find the picture. 
I have created a Matlab function with three inputs and 1 output. Since in the MatLab function block, I have solved a differential equation, it has complex expressions in the form of for example.

(exp(sqrt(-a/b)))

This generates the output of complex data types from the function block. When passing this to the integrator which is the input to my plant, I can not run the Simulink due to the error 

    "Cannot pass the complex value to non-complex location"


I tried changing the data types of the integrator, then the same thing happens to other blocks in the Simulink. 
I also tried using absolute values, which of course gives real numbers, but turns out to be a very large number and generates high magnitude. I really need help in solving this issue.
Can anyone help me in this/ 

Thanks in advance.
The data type of the signal must be fixed in Simulink. Since you use a square root of a real signal, the output will be real if the data is positive, imaginary if negative. Simulink cannot allow that.
The workaround is to use force your real signal to be a complex signal by setting its imaginary part to 0. Then feed the signal to the square root block. The output will always be complex.