How to count negative and postive values in a matrix?

25 ビュー (過去 30 日間)
trailokya
trailokya 2015 年 8 月 5 日
コメント済み: trailokya 2015 年 8 月 5 日
Sir, how can i get the mean and standard deviation and total numbers of negative values and similarly for positive values in a matrix A(i,j).Please help

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2015 年 8 月 5 日
s=sign(A)
ipositif=sum(s(:)==1)
inegatif=sum(s(:)==-1)
  4 件のコメント
Torsten
Torsten 2015 年 8 月 5 日
編集済み: Torsten 2015 年 8 月 5 日
m=mean(A(s==-1))
st=std(A(s==-1))
Best wishes
Torsten.
trailokya
trailokya 2015 年 8 月 5 日
Thank you sir

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by