I was trying to solve this question in cody challenge: Problem 10. Determine whether a vector is monotonically increasing. I tried following code:
i=1;while i<length(x) if x(i)<=x(i+1) tf='true'; else tf='false'; break; end %
i=i+1;end
When I am running this piece of code on MATLAB editor everything is Ok. But when I am submitting this, incorrect answer results. Format to make a function for this problem is given as:
function tf = mono_increase(x) tf = false;end
Can anyone sort it out?
Best Answer