Problem 42320. Write a function man that takes a row vector v and returns a matrix H as follows..
Write a function called man that takes a row vector v as an input and returns a matrix H whose first column consist of the elements of v, whose second column consists of the squares of the elements of v, and whose third column consists of the cubes of the elements v. For example, if A = man(1:3) , then A will be [ 1 1 1; 2 4 8; 3 9 27 ].
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers640
Suggested Problems
-
Get the length of a given vector
12729 Solvers
-
637 Solvers
-
Sum of odd numbers in a matrix
611 Solvers
-
Find the index of n in magic(n)
268 Solvers
-
11147 Solvers
More from this Author3
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!