Group Abstract Group Abstract

Message Boards Message Boards

Make a set of functions using loops?

Posted 9 years ago
POSTED BY: Nicholas Breslin
2 Replies

Something like this?

Do[Print[{a[i] = RandomInteger[{1, 10}], 
   b[i] = RandomInteger[{-10, 10}], c[i] = RandomInteger[{1, 10}], 
   Subscript[A, i][x_] = a[i] Exp[-(x - b[i])^2/(2 c[i]^2)]}], {i, 10}]
G[x_] = Sum[Subscript[A, i][x], {i, 10}]
Plot[Evaluate[
  Join[Table[Subscript[A, i][x], {i, 10}], {G[x]}]], {x, -10, 10}]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard