Hello,
I am new to matlab and have a very, very basic issue. This is a simplified function, but it illustrates the problem I have in my other function.
Matlab seems to bypass my if conditions. Here is the function:
function y = functry(x)Speed = 100;if (x> 100) Speed = 50;endy = Speed * x;end
However, the Speed is taken to be 100 even when I input a high range, for example:
y_try = functry(1:150)plot(1:150, y_try)
Here is still get a linear plot and no change for the Speed when x>100.
Any help would be much appreciated! Thank you!
Best Answer