how to find the sum of matrix?
조회 수: 5 (최근 30일)
이전 댓글 표시
hello, I have a loop as results of K = 1:19, a matrix A (k), my question is how to find the sum (M )of all matrix for each value of k, ie: find M = sum(A (k))
댓글 수: 0
답변 (2개)
Sachin Ganjare
2012년 10월 17일
If I understand your question correctly:
sum_of_all_matrices = sum(A)
댓글 수: 2
Sachin Ganjare
2012년 10월 17일
For Example:
a1 = [1 2 3]; a2 = [1 2 3]; a3 = [1 2 3]; a123 = [a1 a2 a3]; sum_out = sum(a123);
sum_out is sum of elements of matrix
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!