Vectorization of matrix Classic List Threaded 7 messages Open this post in threaded view
|

Vectorization of matrix

 X_norm = (X - (t * mu)) ./ (t * sigma);  %vectorized In above Octave code, if X is 97 x 3 matrix then will it implicitly get converted to column vector? -- Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
Open this post in threaded view
|

Re: Vectorization of matrix

 > X_norm = (X - (t * mu)) ./ (t * sigma);  %vectorized > > In above Octave code, if X is 97 x 3 matrix then will it implicitly get > converted to column vector? I do not see any operation there that would reduce the size of the X matrix. so i dare say no, that wont happen. If this is a norm, you probably need some matrix product against a transpose of X or something on that line.
Open this post in threaded view
|

Re: Vectorization of matrix

 In reply to this post by mayank9889 On Mon, Jun 17, 2019, 8:50 AM mayank9889 <[hidden email]> wrote:X_norm = (X - (t * mu)) ./ (t * sigma);  %vectorized In above Octave code, if X is 97 x 3 matrix then will it implicitly get converted to column vector? What are the shapes of t mu and sigma
Open this post in threaded view
|

Re: Vectorization of matrix

 %X is 97 x 3 matrix X_norm = X; mu = zeros(1, size(X, 2)); sigma = zeros(1, size(X, 2)); mu = mean(X); sigma = std(X); t = ones(length(X), 1); X_norm = (X - (t * mu)) ./ (t * sigma); % Vectorized     -- Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
Open this post in threaded view
|

Re: Vectorization of matrix

 In reply to this post by Juan Pablo Carbajal-2 This is the complete code %X is 97 x 3 matrix X_norm = X; mu = zeros(1, size(X, 2)); sigma = zeros(1, size(X, 2)); mu = mean(X); sigma = std(X); t = ones(length(X), 1); X_norm = (X - (t * mu)) ./ (t * sigma); % Vectorized     -- Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html