Hi,,I am trying to calculate the weight of a matrix.how can i do that> I am explaining below

1 次查看(过去 30 天)
Suppose I have a matrix...
A = [1 0 0 0 ;
1 1 0 0 ;
1 1 1 0 ;
1 1 1 1]
how do I calculate that how many coulmns have only one ONE ? TIA

采纳的回答

the cyclist
the cyclist 2016-5-31
numberOfColumnsThatHaveExactlyOneOne = sum(sum(A==1)==1);
  3 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Decomposition 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by