Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Topic: data extraction from matrix to use in another matrix
Replies: 26   Last Post: Oct 22, 2013 4:57 PM

 Messages: [ Previous | Next ]
 walter Mulvany Posts: 14 Registered: 10/19/13
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!

Date Subject Author
10/19/13 walter Mulvany
10/19/13 dpb
10/19/13 walter Mulvany
10/19/13 dpb
10/19/13 walter Mulvany
10/20/13 dpb
10/20/13 walter Mulvany
10/20/13 dpb
10/20/13 walter Mulvany
10/21/13 walter Mulvany
10/21/13 dpb
10/21/13 dpb
10/21/13 walter Mulvany
10/21/13 dpb
10/21/13 walter Mulvany
10/22/13 walter Mulvany
10/22/13 dpb
10/22/13 walter Mulvany
10/22/13 walter Mulvany
10/22/13 dpb
10/22/13 walter Mulvany
10/22/13 dpb
10/22/13 dpb
10/22/13 walter Mulvany
10/22/13 dpb
10/22/13 dpb
10/20/13 dpb