Question: Matlab Write a function that will go through an array (received as a parameter) and raise each element in the array to the power of
Matlab
Write a function that will go through an array (received as a parameter) and raise each element in the array to the power of it's position, and return the resulting array. For example, if you are given the following array [1, 2, 3, 2, 1] you would perform the following operation:
1^1
2^2
3^3
2^4
1^5
and would return the following array: [1, 4, 27, 16, 1]
You can assume this will always be a 1 dimensional array (or a vector).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
