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


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

Using a Mathematica Program to write a Mathematica Program

From "Harvey P. Dale" <hpd1@nyu.edu>
Newsgroups comp.soft-sys.math.mathematica
Subject Using a Mathematica Program to write a Mathematica Program
Date 2011-05-28 11:19 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <irqln6$e77$1@smc.vnet.net> (permalink)

Show all headers | View raw


	How can one write a Mathematica program the output of which is
itself a Mathematica program?
	 Here is a specific example.  Suppose one runs
FindLinearRecurrence on a sequence of numbers and Mathematica provides a
list of the recurrence factors.  What I would like is to run a program
that would (1) enter the command "Linear Recurrence" plus the opening
square bracket, (2) copy the output of the FindLinearRecurrence program,
i.e., the recurrence factors (as a list), (3) determine the length of
the list of those recurrence factors, (4) take from the sequence of
numbers that had been provided to FindLinearRecurrence the same (first)
number of numbers that corresponds to the length of the recurrence
factors, (5) insert those numbers, as a list, into the program being
created for Linear Recurrence, separated from the recurrence-factor list
by a comma, (6) insert a comma following that, (7) insert a number and
closing square bracket following that, in turn, and (8) provide that
output as a program that could be copied from the output line into a new
input line and run.
	For example, suppose FindLinearRecurrence is run on this list
{2,5,8,11,14,17} producing {2,-1}.  The output I want from the program
to be written would be LinearRecurrence[{2,-1},{2,5},30].
	Any ideas would be welcome.
	Thanks.
	Harvey P. Dale

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________

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


Thread

Using a Mathematica Program to write a Mathematica Program "Harvey P. Dale" <hpd1@nyu.edu> - 2011-05-28 11:19 +0000

csiph-web