3

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!

1 Answer 1

4

An example:

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

>> x.^(1:numel(x))
ans =
    9      49    64   10000  1
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.