Reputation: 15166
I've seen this thread talking about map: 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!
Upvotes: 3
Views: 149
Reputation: 124563
An example:
>> x = randi(10, [1 5])
x =
9 7 4 10 1
>> x.^(1:numel(x))
ans =
9 49 64 10000 1
Upvotes: 4