I am trying to use the find statement in Matlab as a boolean and Im wondering if its even possible, if so how?
This is what I am trying to do
//If The second column in X contains a 1, do something if(find(X(:,2) == 1) == true) //do something
I think you are looking for a function any :
any
if(any(X(:,2) == 1)) //do something
You could achieve something similar using find , but I would not recommend it. Here's one of the options:
find
if(numel(find(X(:,2) == 1)) > 0)