Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*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 2005

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

Search the Archive

Re: Generate polynomial of specified degree

  • To: mathgroup at smc.vnet.net
  • Subject: [mg60643] Re: [mg60618] Generate polynomial of specified degree
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Fri, 23 Sep 2005 04:19:46 -0400 (EDT)
  • Reply-to: hanlonr at cox.net
  • Sender: owner-wri-mathgroup at wolfram.com

f[n_Integer?NonNegative,x_Symbol:x]:=
  ToExpression[CharacterRange["a", FromCharacterCode[97+n]]].
    x^Range[n,0,-1]

Table[f[n],{n,0,3}]

{a, b + a*x, a*x^2 + b*x + c, a*x^3 + b*x^2 + c*x + d}


Bob Hanlon

> 
> From: Renan <renan.birck at gmail.com>
To: mathgroup at smc.vnet.net
> Date: 2005/09/22 Thu AM 02:08:12 EDT
> Subject: [mg60643] [mg60618] Generate polynomial of specified degree
> 
> Hello,
> 
> Sorry if this may seem a silly question, but I readed the Mathematica
> help and found no references.
> 
> Is there any function that can generate a polynomial of a given degree?
> 
> e.g.
> 
> For degree 1, f[x] would return a x + b
> For degree 2, f[x] would return a x^2 + b x + c (quadratic equation)
> For degree 3, f[x] would return a x^3 + b x^2 + c x + d (quadratic 
equation)
> 
> Thanks,
> Renan - Canoas, RS, Brazil
> 
> 


  • Prev by Date: Re: Running ps2pdf from within Mathematica
  • Next by Date: Re: Mathemaica 5.2 are the 64 Bit an illusion !!!....?
  • Previous by thread: Re: Generate polynomial of specified degree
  • Next by thread: Re: Generate polynomial of specified degree