Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1992
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1992

[Date Index] [Thread Index] [Author Index]

Search the Archive

Array problems in Mathematica

  • To: mathgroup at yoda.physics.unc.edu (Mathematica user group)
  • Subject: Array problems in Mathematica
  • From: Mark Sofroniou <M.Sofroniou at loughborough.ac.uk>
  • Date: Tue, 11 Feb 92 14:33:49 GMT

Has anyone come accros the following?

Firstly, applying N[] to an array also carries through to the arguments.
i.e. N[2 a[1]] = 2. a[1.] and not 2. a[1]
Is there a way to protect the arguments of an array from N[]?

Secondly, using CForm on arrays gives the output in unappropriate form.
i.e. CForm[a[1]] = a(1) and not a[1]
Now try to write a C program splicing in output from Mathematica containing
arrays and the compiler recognises a() as a function, not an array.
Is there a way round this? I really can't understand the logic here, since
both Mathematica and C use [] for array arguments, so why should CForm[] convert
to ()?

I would be most grateful if anyone has any suggestions.

					Thanks in advance
							Mark Sofroniou.





  • Prev by Date: Graphing discontinuous functions
  • Next by Date: Mouse input on X-windows
  • Previous by thread: Graphing discontinuous functions
  • Next by thread: Re: Array problems in Mathematica