Matlab: How do I use a logical matrix in a if statement? -
i have logical matrix
logicmatrix = [ 0 0 0 1 1 1 0 0 1 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0]
i need if statement check , each row 1. (any column, multiple columns, or columns; if row has 1 if statement gets run through)
i used while matrix vector had increase size of columns , doesn't work
if logicmatrix(rowindex) == 1
the answer found works this. help.
if any(logicmatrix(rowindex,:)) == 1
Comments
Post a Comment