How to calculate number that satisfy the condition

2 ビュー (過去 30 日間)
Alya Z
Alya Z 2017 年 12 月 11 日
コメント済み: Alya Z 2017 年 12 月 11 日
I have two 281x281 sets of matrix. A is a prescribed data whereby B is tracked data. I would like to calculate the difference of these two sets data and then calculate how many data that satisfy the condition.
For example, how many data satisfy condition <5, how many >5 and etc

採用された回答

Walter Roberson
Walter Roberson 2017 年 12 月 11 日
C = double(A) - double(B);
nnz(C < 5)
nnz(C > 5)
Note: in some contexts, talking about the "difference" between the two would imply
C = abs(double(A) - double(B));

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeBar Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by