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.