I have to add the values that are inside the matrix called s
古いコメントを表示
s= [...
99 99 0.100 0.120 0 0.500 0;
0 0 0 0 0.150 0.120 0;
0.110 0.010 0.010 0 0 0.300 0.100;
0 0.250 0 0.050 0.060 0.100 0.110;
0 0.120 0.040 0 0.500 0.750 1.200];
I have a file with different matrices. I want to write a general code that will add all the values inside this matrix without including the last two in this case 0.750 1.200 and the 99's
so far I have
r=(s(1:5,1:7))
y=sum(r(r<99))
I don't know to remove the last two values as in a general code that will work for the rest of the matrices.
4 件のコメント
Azzi Abdelmalek
2012 年 12 月 2 日
what is the size of your matrix s, If you remove two elements, how can you save s in a new matrix?
marie
2012 年 12 月 2 日
Azzi Abdelmalek
2012 年 12 月 2 日
What do you mean by and the 99's
marie
2012 年 12 月 2 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!