How to apply OR operation to a matrix?

1 ビュー (過去 30 日間)
pietro 2014 年 7 月 12 日
回答済み: Roger Stafford 2014 年 7 月 12 日
Hi folk,
I need to apply the OR operation to the column of a matrix. Here an example:
a=[0 0 1; 0 1 1];
[0 0 1]


Roger Stafford
Roger Stafford 2014 年 7 月 12 日
Your example is not the 'OR', it is the 'AND', of the columns. The 'OR' of the columns is done this way:
b = any(a,1);
The 'AND' would be done this way:
b = all(a,1);

その他の回答 (0 件)


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by