Question: Exercise 9 : Practice some of these methods for accessing matrix elements with the following exercises: Create a matrix of size N N that has

Exercise 9: Practice some of these methods for accessing matrix elements with the following exercises:
Create a matrix of size NN that has ones in the border and zeros inside. For example if N=3 the matrix can be created with
>> A=ones(3,3); A(2,2)=0
Make this construction depend on N and work for any positive integer N2
Create a 55 matrix whose rows are (1:5)
Extract the diagonal of a given matrix without using diag (you may use size)
Flip a given matrix horiztonally. Vertically? Do not use fliplr or flipud
Extract the anti-diagonal of a given matrix
Extract the anti-djagonal, without first flipping it (Hint: use single index access)
 Exercise 9: Practice some of these methods for accessing matrix elements

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!