Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Last term of an nxn matrix' topicStudent Support Forum > General > Archives > "Last term of an nxn matrix"

Next Comment >Help | Reply To Topic
Author Comment/Response
Richard
03/30/08 8:03pm

I have an nxn matrix where I want the term in position (n,n). The only way I can figure out how to do this is:

lastTerm = rombergMatrix[[Dimensions[rombergMatrix][[1]]]][[Dimensions[rombergMatrix][[1]]]];

Now of course, I could just make one call to dimensions, save it in a variable and just use that. But is there a better way to do this?

I come across a lot of situations where I mathematica code is just ugly, although never to this extent. I get the feeling I'm not using the language the way it was intended (i.e. there are alternative, better, ways). I'm a CS major and I started programming with C/C++, so perhaps it's just a different mindset?

URL: ,

Subject (listing for 'Last term of an nxn matrix')
Author Date Posted
Last term of an nxn matrix Richard 03/30/08 8:03pm
Re: Last term of an nxn matrix Xavier 03/31/08 00:16am
Re: Last term of an nxn matrix fred engles 03/31/08 11:53am
Re: Last term of an nxn matrix yehuda ben-s... 03/31/08 5:42pm
Re: Last term of an nxn matrix Jasper Levink 04/01/08 01:23am
Next Comment >Help | Reply To Topic