I could get two inputs fed to the function block by using the "mux" block. Now I am facing another issue.
In the function, the returned value is a real number. And I set the output width as 1 and set the output type as real. But simulink gives an error "Evaluation of expression...