Operations with rows First, second and third

5 ビュー (過去 30 日間)
AIRTON
AIRTON 2025 年 9 月 2 日
回答済み: Matt J 2025 年 9 月 2 日
I have a matriz
a = [0 1 1 0 0 1 0 1 0; 1 1 0 1 0 0 1 1 1; 0 0 0 1 1 1 0 0 1]
a = 3×9
0 1 1 0 0 1 0 1 0 1 1 0 1 0 0 1 1 1 0 0 0 1 1 1 0 0 1
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
I want to know how many times happen, in the same position, zero in the First row and 1 in the second row. After that, the first row and third row.
And then, I want to know the same with second row and first e third row.
Finally, third row and first row and second row.
I don’t know Very of MATLAB.
Thanks!!!

採用された回答

Matt J
Matt J 2025 年 9 月 2 日
For example,
a = [0 1 1 0 0 1 0 1 0; 1 1 0 1 0 0 1 1 1; 0 0 0 1 1 1 0 0 1]
a = 3×9
0 1 1 0 0 1 0 1 0 1 1 0 1 0 0 1 1 1 0 0 0 1 1 1 0 0 1
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
first_and_second = sum( ~a(1,:)&a(2,:))
first_and_second = 4

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOperators and Elementary Operations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by