Info

この質問は閉じられています。 編集または回答するには再度開いてください。

And/or between two 3d arrays

1 回表示 (過去 30 日間)
Espen Mikkelsen
Espen Mikkelsen 2019 年 2 月 11 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I have two 3d arrays sized 40*60*157000. I want to count number of values with array1 > 250 and/or array2 >170 into one third 2d array. For example if a value in array1 is under 250, then the corresponding value in array2 have to be higher than 170 to be valid in the third array. If array1 is over 250, then its doesnt matter if array2 is over or under 170 to be valid in the third array. I want to do this for each of the 40x60 values. This will give me a 3d array of 40x60x1. I only know the code with "and" which is working like this:
sum(array1>250 & array2>170,3);
  1 件のコメント
madhan ravi
madhan ravi 2019 年 2 月 11 日
Just illustrate with a small example.

回答 (1 件)

James Tursa
James Tursa 2019 年 2 月 11 日
Do you mean this?
sum(array1>250 & array2>170,3);

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by