Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Part Function
Replies: 2   Last Post: Jan 24, 2014 4:19 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Tomas Garza Hernandez

Posts: 264
Registered: 4/15/05
Re: Part Function
Posted: Jan 24, 2014 4:19 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


As you say, Q1 is a 96 x 96 matrix, i.e., a list of 96 lists, each of which has 96 elements. Hence Part[Q1[[k]],1] (which you may also write as Q1[[k,1]] or even Q1[[k]][[1]]) has a clear meaning. The expression Q1[k,1] is meaningless (since Q1 is not a function) and will return exactly the same thing you typed as input. (Unless, of course, you have previously defined an Array (q.v.) with the name Q1, but that is another matter). By the way, use of uppercase is not recommended for the first letter in the names of variables, as they may be confused with Mathematica symbols.
-Tomas


> From: fnajmy@gmail.com
> Subject: Part Function
> To: mathgroup@smc.vnet.net
> Date: Thu, 23 Jan 2014 03:34:45 -0500
>
> I have a Mathematica script containing the following line:
>
> v[k_] := SetAccuracy(2*(Part[Q1[[k]],1]),45]
>
> where Q1 is a 96 x 96 matrix.
>
> Is Part[Q1[[k]],1] the same as Q1[k,1]? If not, what is it returning?
>
> Any help appreciated.
>




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.