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

Popular posts from this blog

iphone - Three second countdown in cocos2d -

hyperlink - how to do url routing in php -

c - Avoiding Extra Malloc in Linked List (node->next = NULL) -