Question
Matlab question Write a function that takes a row array as an input and produces a matrix as an output. If the input array is
Matlab question
Write a function that takes a row array as an input and produces a matrix as an output. If the input array is n in length, the output matrix should be n x n. The first row of the matrix should be the original array. Every subsequent row should be the row above modified in the following way:
- The number in the last column is the same
- For the other columns, place the value from the previous row in that column times the value from the previous row in the next column.
For example, the input [1 -1 2 -2 -1] would produce the matrix:
1 -1 2 -2 -1
-1 -2 -4 2 -1
2 8 -8 -2 -1
16 -64 16 2 -1
-1024 -1024 32 -2 -1
In the above matrix, for each set of bolded numbers, the number on the bottom is the product of the numbers on top.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started