I'm trying to create a function with the switch /case commands and run it from another program satisfying certain criteria. The files are in the same folder but I'm not sure how to lay out the function and call it for that matter. Here is my function file:
function input = g(x) switch input case x < -pi disp('-1') case g >= -1 && g<= pi cos(g) case g > pi disp('-1')
end
Thanks for you help
Best Answer