2 visualizzazioni (ultimi 30 giorni)
PARTHA HALDAR il 25 Lug 2016
Commentato: PARTHA HALDAR il 25 Lug 2016
I have a matrix of order say m*n. Now each column will have some mean. I want to know how can I subtract that mean value from the elements of that particular column so that I can obtain a new standardised matrix of same order?
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Risposte (2)

Andrei Bobrov il 25 Lug 2016
a = randi(20,8,6);
out = bsxfun(@minus,a,mean(a));
##### 1 CommentoMostra -1 commenti meno recentiNascondi -1 commenti meno recenti
PARTHA HALDAR il 25 Lug 2016
Thanks

Accedi per commentare.

Vaclav Rimal il 25 Lug 2016
Given that your original matrix is Aorig, do the following:
Anew = Aorig - ones(size(Aorig,1),1)*mean(Aorig);
Note that you need the multiplication by vector of ones to obtain the correct size of the subtracted matrix. You could also use repmat but it is not that fast.
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Categorie

Scopri di più su Logical in Help Center e File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by