I have to perform the following task

1 visualización (últimos 30 días)
Jay Mistry
Jay Mistry el 12 de Nov. de 2018
Editada: Jay Mistry el 14 de Nov. de 2018
I have an excel data sheet which contains 400X7 values and the following task are to be performed....
  1. Display the data in form of a matrix (400 x 7) in matlab
  2. Multiply each coulmn with each other ( For ex. Column 1* Column 1, Column 1* Column 2, Column 1* Column 3, similarly 1 with 4, 2 with 1 and so on)
  3. Take Mean of each Column multiplication results
  4. Form a 400 x 7 Matrix
  5. So the mean of multiplication of Column 1 with Column 1 will be the first element (R11) of 400 x 7 matrix, the mean of multiplication of Column 1 with Column 2 will be the 2nd element (R12) of 400 x 7 matrix like wise I need to calulate each and every value of 400 x 7 matrix
Any suggestions pls
  4 comentarios
Arunkumar M
Arunkumar M el 13 de Nov. de 2018
Editada: Arunkumar M el 13 de Nov. de 2018
What do you mean by multiplying Column 1 with Column 1?
You cant multiply m x 1 vector with m x 1 vector.
Do you mean to perform a element wise multiplication? - if so, this again results in m x 1 vector and you can find mean of it.
Jay Mistry
Jay Mistry el 13 de Nov. de 2018
Editada: Jay Mistry el 14 de Nov. de 2018
I mean multiplying matrix column 1 with column 1, Column 1 with C2, C1 with C4, C1 with C5, C1 with C6, C1 with C7,
Column 2 with Column 1, Column 2 with Column 2,Column 2 with Column 3,Column 2 with Column 4,Column 2 with Column 5,Column 2 with Column 6,Column 2 with Column 7,
Column 3 with Column 1,Column 3 with Column 2,.......
'' '' '' '' " "
'' '' " " " "
Column 7 with Column 1 ...........Column 7 with Column 7.
Multiplying each and every column with each other

Iniciar sesión para comentar.

Respuestas (1)

KSSV
KSSV el 13 de Nov. de 2018
[num,txt,raw] = xlsread(myexcelfile) ;
% num will give you your 400*7 matrix
iwant = num(:,1).*num ; % this mulitplies every column with first column
themean1 = mean(num,1) ; %mean of columns
themean2 = mean(num,2) ; % mean of rows

Categorías

Más información sobre Data Import from MATLAB en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by