Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #16478

Re: Part Function

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!newspump.sol.net!posts.news.twtelecom.net!nnrp3.twtelecom.net!not-for-mail
From Bob Hanlon <hanlonr357@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Part Function
Date Fri, 24 Jan 2014 09:18:47 +0000 (UTC)
Sender steve@smc.vnet.net
Approved Steven M. Christensen <steve@smc.vnet.net>, Moderator
Message-ID <lbtb5n$c8f$1@smc.vnet.net> (permalink)
References <20140123083445.902A469D4@smc.vnet.net>
Lines 45
Organization Time-Warner Telecom
NNTP-Posting-Date 24 Jan 2014 09:24:06 GMT
NNTP-Posting-Host 43ca8c8b.news.twtelecom.net
X-Trace DXC=JhTaBd=S46S2?jHgl5=_;YC_A=>8kQj6];[h;PUXBgbT\BjXfi;a<@YEFiONJ7[GoV\l^eoShVW=\
X-Complaints-To abuse@twtelecom.net
Xref csiph.com comp.soft-sys.math.mathematica:16478

Show key headers only | View raw


Q1[k, 1] doesn't return anything useful since Q1 is not a function and
[k,1] is the form of an argument to a function.


For a part, you should be using Q1[[k,1]] rather than Q1[k,1].


Q1 = Array[q, {96, 96}];


With[{
  k = RandomInteger[{1, 96}],
  n = RandomInteger[{1, 96}]},
 Part[Q1[[k]], n] === Q1[[k]][[n]] === Q1[[k, n]]
 ]


True


See documentation for Part.



Bob Hanlon




On Thu, Jan 23, 2014 at 3:34 AM, Fred Najmy <fnajmy@gmail.com> wrote:

> 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.
>
>

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Part Function Bob Hanlon <hanlonr357@gmail.com> - 2014-01-24 09:18 +0000

csiph-web