Question: function [ B , C , D ] = matrixFun ( A ) % Create a new matrix B that consists of the first and

function [B, C, D]= matrixFun(A)
% Create a new matrix B that consists of the first and last rows of A
B = A([1, end], :);
% Create a new matrix C that consists of the elements at the four corners of A
C = A([1,1, end, end],[1, end]);
% Create a new matrix D that consists of the second through last columns
% in the second through last rows of A
D = A(2:end-1,2:end-1);
end

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!