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

2 ビュー (過去 30 日間)
PIRIL
PIRIL 2014 年 2 月 21 日
コメント済み: PIRIL 2014 年 2 月 21 日
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 !

採用された回答

Andrei Bobrov
Andrei Bobrov 2014 年 2 月 21 日
A=[3.5,4.5;2.4,3.2];
out = bsxfun(@minus,A,A(:,1));

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeElementary Math についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by