# Syntax for evaluating a polynomial that is an element of a sequence?

Rulatir shared this question 3 years ago

I have defined a Sequence Wx of polynomials.

I want to write an expression that will evaluate to the value of j-th polynomial in the sequence Wx for argument t.

In other words, I want to first index into the sequence Wx retrieving a polynomial from it, and then evaluate that polynomial for argument t. This must be a single expression.

Naive attempt:

`Element(Wx, j)(t)`

results in a syntax error.

How do I?

1

I don't know if this is the best syntax :) but it works so far.

Eval=Iteration(Element(Wx,j), t, 1)

j is the position of the element in the list

t is the value to be substituted in the related function

1

try

y(intersect(element(Wx,j),x=t)

or open the CAS then Substitute(Wx, {x=t}) for all values

2

Although the interest of the questioner is not impressive:

here one possibility more with Zip().

See attachment.

2

It seems that mySequenceOfPolynomials(index, xValue) just works. And it works for sequences of sequences too, with appropriate number of indexes. Is this a new feature added within the last two years, or something I have missed all along? I understood that when I create a sequence, it is just a simple object that stores elements, and the only thing I can do with it is retrieve an element from it. I didn't know about this automatic uncurrying that works with some types of functionlike objects but not with others. It certainly shouldn't be assumed to be obvious.

1

sin duda esto es nuevo