Message Boards Message Boards

0
|
2197 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

Enumeration of variables in function definition

Posted 10 years ago

I have variables enumerated by square parentheses: x[i], however I am unable to define a function by these variables:

f[x[1]_]:= x[1]^2

This doesn't work. What can be done? Thanks.

POSTED BY: Al Guy
f[x_[y_]] := x[y]^2
POSTED BY: David Reiss
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract