I have to find the sum of the elements in the upper dimension matrix and this is the code i came up with. When I submitted this code it's showing error.
조회 수: 2 (최근 30일)
이전 댓글 표시
function summa=halfsum(A)
n=length(A);
k=1;
[m,p]=size(A);
if m~=p
return
else
summa=0;
for i=1:n
for j=k:n
summa=summa+A(i,j);
end
k=k+1;
end
end
채택된 답변
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!