I have an array that represents the time based states of an analysis. I want to search the array for where a certain state starts, and if the state doesn't exist, then pick the final index of the array.
statestart = find(Results.state==5,1);
statestart = numel(Results.state);
I know this works, but I would like to know if it's possible to get the same result without an if statement.