Question: this is a matlab problem * the second picture contains hw 2 Start with the following line of code: toeplitzSize=66; Write a for loop to

 this is a matlab problem * the second picture contains hw
this is a matlab problem *
2 Start with the following line of code: toeplitzSize=66; Write a for
the second picture contains hw 2

Start with the following line of code: toeplitzSize=66; Write a for loop to create a toeplitzSize by toeplitzSize "Toeplitz" matrix, as in the extra credit problem in Homework 2. That is, setting toeplitzSize=8 should yield the answer to problem 5 in Homework 2, and setting toeplitz Size=10 should yield the matrix at the bottom of page 2 of Homework 2. Use this code to create a 66 by 66 "Toeplitz" matrix, storing the result as toeplitz 66 (2 points). If you did the extra credit 5. Create a 8 by 8 numeric (double) matrix called toeplitz. The matrix will look like (2 points). 1 2 3 4 5 6 7 8 2 1 2 3 4 5 6 7 3 2 1 2 3 4 5 6 4 3 2 1 2 3 4 5 5 4 3 2 1 2 3 4 6 5 4 3 2 1 2 3 7 6 5 4 3 2 1 2 8 7 6 5 4 3 2 1 Do not create the matrix by entering in values directly. Instead, start with toeplitz-eye (8); and replace the O's in toeplitz with the numbers 2 to 8 (in sets, not one at a time) until you achieve the desired output. For instance, you can modify the rest of the first column with toeplitz (2:8,1) -2:8. NOTE: If needed, some of your replacements can be of individual elements, but most of the commands that replace elements of toeplitz should replace multiple elements at once. a. EXTRA CREDIT: Chances are, the code you wrote for the first part of this problem is not flexible; that is, whenever we need a bigger or smaller matrix with the same structure (1's on the diagonal, with increasing values further from the diagonal) we would need to make numerous changes to the code and add or remove lines. Instead, flexible code will start with something like: toeplitzSize=7; When toeplitzSize (and nothing else) is changed, flexible code will produce a toeplitzSize by toeplitzSize matrix with the same structure as toeplitz. In the next lecture (W3D1) we will learn conditionals and loops, which can be readily applied to this problem. Starting with the above command, write code that will create a toeplitzSize by toeplitzSize matrix with the same structure as toeplitz. Do not use conditionals or loops. To demonstrate your code, create a 666 by 666 Toeplitz matrix by setting toeplitzSize -666 and store the result as toeplitz666. (3 points). For instance, setting toeplitzSize = 8 should yield the solution to Question 5, and setting toeplitzSize =10 should yield the following matrix: 1 2 3 4 5 6 7 8 9 10 2 1 2 3 4 5 6 7 8 9 3 2 1 2 3 4 5 6 7 8 4 3 2 1 2 3 4 5 6 7 5 4 3 2 1 2 3 4 5 6 6 5 4 3 2 1 2 3 4 5 7 6 5 4 3 2 1 2 3 4 8 7 6 5 4 3 2 1 2 3 9 8 7 6 5 4 3 2 1 2 10 9 8 7 6 5 4 3 2 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!