logical operators on a logical matrix

35 ビュー (過去 30 日間)
Pankaj
Pankaj 2019 年 9 月 13 日
コメント済み: Pankaj 2019 年 9 月 13 日
Consider the following logical matrix of 4X2
A = logical([1, 0; 1, 1; 0, 0; 0, 1])
I would like to apply logical operator (say `or`, `and`) on the matrix row wise so the result is 4X1 vector. (the matrix could of any dimension say mXn, and I want mX1 as output). The `or` operator requires two matrices for comparision, how to do it for single matrix.

採用された回答

madhan ravi
madhan ravi 2019 年 9 月 13 日
all(A,2)
any(A,2)
  4 件のコメント
madhan ravi
madhan ravi 2019 年 9 月 13 日
Thanks Jos :)
Pankaj
Pankaj 2019 年 9 月 13 日
thanks Jos

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by