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


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

Re: Part Function

From Alexei Boulbitch <Alexei.Boulbitch@iee.lu>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Part Function
Date 2014-01-24 09:19 +0000
Message-ID <lbtb70$c8l$1@smc.vnet.net> (permalink)
Organization Time-Warner Telecom

Show all headers | View raw


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.


Hi, Fred,
It is easy to see what is it by generating a simple example. Let us define a small matrix
as follows:

Q[k_] := {{k + 1, k - 1}, {k^2, 1/k}}

You can have a look at it. Evaluate this:

Q[k] // MatrixForm.

Now the expression you are asking about is:

Part[Q[k], 1]

Evaluate it! The result is below:

{1 + k, -1 + k}

Thus, it returns the first line of the matrix.

Have fun,  Alexei

Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG

Office phone :  +352-2454-2566
Office fax:       +352-2454-3566
mobile phone:  +49 151 52 40 66 44

e-mail: alexei.boulbitch@iee.lu


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


Thread

Re: Part Function Alexei Boulbitch <Alexei.Boulbitch@iee.lu> - 2014-01-24 09:19 +0000

csiph-web