From: karan on
I have matrix J and K given to me and i want to get matix A by combining using relation between rows {5,7,8}of matrix J and rows {5,4,1} of matrix K.
m = size(J,1) + size(K,1)-3
A=zeros(m)
M1 = J([5,7,8],[5,7,8])
M2 = K([5,4,1],[5,4,1])
A([5,4,1],[5,4,1]) = M1 +M2
m2=J([1,2,3,4,6],:)
A(10:14,[10,11,12,13,5,14,4,1])=m2
m1=K([2,3,6,7,8,9],:)
A([2,3,6,7,8,9],1:9)=m1

I want to do this in terms of variables like i define {5,7,8} as an array , similarly {5,4,1} as array so when i define M1 = J(array,array) and for m2 = J(all rows - array,:)...plz help me.this is just an idea.plz ask for clarifications if needed
From: sscnekro on
> plz help me

Hi karan, too much panic won't help you.

Do you have the possibility to read this online?
http://www.mathworks.com/access/helpdesk/help/techdoc/learn_matlab/f2-8955.html

Otherwise, you may download this and go through the 2nd chapter
http://www.mathworks.com/access/helpdesk/help/pdf_doc/matlab/getstart.pdf

Otherwise, could you describe what should your resulting A matrix contain? E.g. the first row of A should be taken from the fifth row of J, etc.