Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #5950
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!novia!news-out.readnews.com!news-xxxfer.readnews.com!newspump.sol.net!post2.nntp.sol.net!posts.news.twtelecom.net!nnrp3.twtelecom.net!not-for-mail |
|---|---|
| From | "Dr. Wolfgang Hintze" <weh@snafu.de> |
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Using values from inside a matrix for a new row |
| Date | Fri, 28 Oct 2011 09:33:05 +0000 (UTC) |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Sender | steve@smc.vnet.net |
| Approved | Steven M. Christensen <steve@smc.vnet.net>, Moderator |
| Message-ID | <j8dssh$k4j$1@smc.vnet.net> (permalink) |
| References | <j89vb0$1st$1@smc.vnet.net> |
| Lines | 45 |
| NNTP-Posting-Date | 28 Oct 2011 08:36:54 GMT |
| NNTP-Posting-Host | 3db30cb5.news.twtelecom.net |
| X-Trace | DXC=_[<<XWJM:n_Xg:DhlW=laUC_A=>8kQj6]=_1NR_H?JP]b95`<gFe:DZEFiONJ7[GoV<Ie\F?P_>M[ |
| X-Complaints-To | abuse@twtelecom.net |
| Xref | x330-a1.tempe.blueboxinc.net comp.soft-sys.math.mathematica:5950 |
Show key headers only | View raw
"Michelle A" <hfvballgurl33@gmail.com> schrieb im Newsbeitrag
news:j89vb0$1st$1@smc.vnet.net...
> Hello,
> I am new to Mathematica and I am trying to create an array of values
> that uses info from the line above. I'm thinking of it like how
> Excel
> would do it but I'm not sure how to go about it in Mathematica. I've
> been getting the RecursionLimit error when I try to call an earlier
> element of the array.
>
> Here is what I'm thinking in a simplified form:
>
> Say I simply want to add a constant (1 here) to each element above.
> So
> I want my answer to be like this:
>
> 1 2 3
> 2 3 4
> 3 4 5
>
> f = {{1, 2, 3}, {f[[1, 1]] + 1, f[[1, 2]] + 1, f[[1, 2]] + 1}} and
> continue to have it grow to be a 10x3 matrix. I know I'll need some
> i's and j's but I can't get it to work. Do I need to initialize an
> array or make a loop to just add one row at a time in a separate
> step?
>
> Any help is greatly appreciated. Thank you
>
>
It is very easy. See this
In[51]:=
data = Table[Random[Integer, {1, 10}], {3}]
Out[51]=
{3, 9, 10}
In[52]:=
data + 1
Out[52]=
{4, 10, 11}
--- Wolfgang
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread
Using values from inside a matrix for a new row Michelle A <hfvballgurl33@gmail.com> - 2011-10-26 21:50 +0000 Re: Using values from inside a matrix for a new row "andre.robin3" <andre.robin3@wanadoo.fr> - 2011-10-27 10:43 +0000 Re: Using values from inside a matrix for a new row Ray Koopman <koopman@sfu.ca> - 2011-10-27 10:46 +0000 Re: Using values from inside a matrix for a new row "Dr. Wolfgang Hintze" <weh@snafu.de> - 2011-10-28 09:33 +0000
csiph-web