Question: Problem 1: An 5-by-5 matrix X-magic(5) is given. Without using loops, extract values from matrix X to create the following: i) matrix A-composed of all

Problem 1: An 5-by-5 matrix X-magic(5) is given. Without using loops, extract values from matrix X to create the following: i) matrix A-composed of all values in odd columns AND odd rows of x (as 3x3 matrix), e.g.: ii) matrix B-composed of all entries of X, except for the outside rows and columns, e.g. (answer should be a 3x3 matrix): iii) matrix C-composed of diagonals surrounding the middle diagonal of matrix X (answer should be a 4x2 matrix), e.g.: Hint: try solving this using the diagonal function (type 'help diag' in the command window and read about the function options to select the diagonal or kth diagonal entries). Problem 2: Write a script that will sum up all the positive and negative entries in a matrix of integers (use logical arrays or the find function). Create the matrix within your script using the randi function: Matrix = randif(-55), (3 4]) %make a 3x4 matrix with random integers from 5 to 5 For example: Matrix= 5-2 05 3 0 2-5 3 2 -3 -1 The Positive Sum is: 20 The Negative Sum is: -11 Problem 3: Load the xlsx data file 'Top_NFL_Fantasy_Stats. Use the full xlsread function to get the numerical (num) and the text (txt) data (ignore raw for now) using: Inum, txt,raw]-xlsread() Find and print out the name of the player and the top # of passing yards for this NFL season using fprintf while being careful of the header at the top of the txt variable and verifying from that data that the correct player was identified Hint: Since the txt variable is a cell array of names, you could either convert the txt variable from a cell to a string using the "string" function (I.e. player = string(txt(2,2)) will output 'player - "Russell Wilson") or use () to index the cell array (l.e. player=txt{2,2) will output "player = 'Russell Wilson")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
