17.0k views
0 votes
After you define two matrices year1 and year2 from two tables, create a multidimensional array called testdata with 2 pages each stores first and second years’ test data. Note that year 1 and year 2 are 5x4 arrays and just include numeric data only.

User Fedd
by
3.3k points

1 Answer

3 votes

Answer:

Check the explanation

Step-by-step explanation:

clc,clear

%% (1)

% create a 5x4 array, year1

year1 = [3 6 4 10;

5 8 6 10;

4 9 5 10;

6 4 7 9;

3 5 8 10

];

% create a 5x4 array, year2

year2 = [2 7 3 10;

3 7 5 10;

4 5 5 10;

3 3 8 10;

3 5 2 10

];

%

% concatenate 2d arrays to form 3d array

testdata = cat(3,year1,year2);

%%%

% extract the third column of every year and form a 2d array, question_3

question_3 = [testdata(:,3,1) testdata(:,3,2)];

disp('question_3: '),disp(question_3)

%

%%

User Gaddy
by
3.0k points