Create an index-powered vector - MATLAB Cody - MATLAB Central

Problem 1786. Create an index-powered vector

Difficulty:Rate

Given a input vector x, return y as index-powered vector as shown below.

Example

 x = [2 3 6 9]

then y should be

 [2^1 3^2 6^3 9^4] = [2 9 216 6561]

Solution Stats

68.07% Correct | 31.93% Incorrect
Last Solution submitted on Jun 30, 2025

Problem Comments

Solution Comments

Show comments
Why should you share code?
In a discussion on LInkedin about my recent blog post, Do these...
3
6

Problem Recent Solvers846

Suggested Problems

More from this Author25

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!