Akzeptierte Antwort

Image Analyst
Image Analyst am 25 Nov. 2011

1 Stimme

Try bsxfun:
% Generate sample data.
m = rand(3,5)
% Extract out the first column
m1 = m(:,1)
% Subtract first column from all the columns.
mMinusM1 = bsxfun(@minus,m,m1)

2 Kommentare

Titus Edelhofer
Titus Edelhofer am 25 Nov. 2011
Small typo, to reproduce the example you need to subtract m from m1: m1MinusM = bsxfun(@minus, m1, m).
zozo
zozo am 26 Nov. 2011
thank you!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by