tags:

views:

49

answers:

1

Hi all,

I've seen this thread talking about map: http://stackoverflow.com/questions/983163/map-function-in-matlab

As a result, I was wondering whether there are similar ways to do it taking into consideration of the indices. Such as if i want to do something like (x_i)^i.

thanks a lot!

+4  A: 

An example:

>> x = randi(10, [1 5])
x =
     9     7     4    10     1

>> x.^(1:numel(x))
ans =
    9      49    64   10000  1
Amro

related questions