multiplying certain parts of an 8x8 matrix
古いコメントを表示
How do I sum the 4 corners and 4 middle numbers of an 8x8 magic matrix?
1 件のコメント
Jan
2011 年 1 月 29 日
You mention a mutliplication in the subject, but ask for a sum in the body.
回答 (2 件)
Walter Roberson
2011 年 1 月 28 日
0 投票
sum( [M(1,1), M(1,end), M(end,1), M(end,end), reshape(M(floor(end/2):floor(end/2)+1,floor(end/2):floor(end/2)+1),1,[]) ])
カテゴリ
ヘルプ センター および File Exchange で MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!