필터 지우기
필터 지우기

hi my matrix=12x5, i need to subtract all these and finally get 12x1 i.e 12x1-12x2, result of (12x1-12x2)-12x3,then result of ((12x1-12x​2)-12x3)-1​2x4.......​..........​.so on

조회 수: 2 (최근 30일)
plz help me with matlab code

채택된 답변

Ahmed raafat
Ahmed raafat 2016년 12월 29일
you said that your matrix is 5 cols so (your matrix variable is mat
out=mat(:,1);
for i=2:5
out=out-mat(:,i);
end
This worked for me alot

추가 답변 (1개)

Roger Stafford
Roger Stafford 2016년 12월 29일
Let M be your 12 by 5 matrix and V your result.
V = M(:,1)-sum(M(:,2:end),2);

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by