
data extraction from matrix to use in another matrix
Posted:
Oct 19, 2013 12:03 PM


I'm writing a code for finite element analysis and I don't know how to read a value from a matrix (A) and use it as a pointer to direct me to values in another matrix. Here is a sample of the problem. disp('Number of elements?') nelem=input(''); connectivity=[1,1,2;2,1,3;3,2,3] disp ('Elem # Node(a) Node(b)') disp(connectivity) coordinates=[1,0,0;2,2,0;3,1,2] disp ('Node # Xcoord Ycoord') disp(coordinates) disp('press enter to continue') pause for i= 1:nelem nodeax(i)=sscanf(connect(i,2)); nodeaj(i)=sscanf(connect(i,2)); end I need to read element's 1 node(a) which in this case is 1, and use that 1 to direct me to the node 1, extract the x and y coordinate from node 1, and create a matrix.
Thank you in advance for the help!

