Dear all, I need your help in defining a function over a vector as follows.
First, I need to define a n-dimensional vector X, taking n as a variable rather than a particular value. Second, I need to define a function of X in the following way. Y(i) = 1 if i = n; Y(i) = X(i) if 1<= i <= n-1; Y(i) = 0 if i = 0.
Any suggestions? Thanks.