Subtracting the first element of each row from the rest of the row ?

Hi all,
I have a matrix like A=[3.5,4.5;2.4,3.2]. I want to subtract the first element of each row from the rest of the row resulting in [0,1.5;0,0.7].
Many thanks !

 채택된 답변

A=[3.5,4.5;2.4,3.2];
out = bsxfun(@minus,A,A(:,1));

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

태그

질문:

2014년 2월 21일

댓글:

2014년 2월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by