Solution to HW2 - EGM3344 HW2 Solution Problem 2.3>> x = linspace(0 10 6>> A =[3 x 5 x 20 A = 6 12 18 24 30 20 10 10 20 30 Problem

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: EGM3344 HW2 Solution Problem 2.3 >> x = linspace(0, 10, 6); >> A = [3 * x; 5 * x- 20] A = 6 12 18 24 30- 20- 10 10 20 30 Problem 2.6 >> A = [3 7- 4 12;- 5 9 10 2; 6 13 8 11; 15 5 4 1]; >> B = A(:,2:4) B = 7- 4 12 9 10 2 13 8 11 5 4 1 >> C = A(2:4,:) C =- 5 9 10 2 6 13 8 11 15 5 4 1 >> D = A(1:2,2:4) D = 7- 4 12 9 10 2 1 Problem 2.8 >> A = [3 7- 4 12;- 5 9 10 2;6 13 8 11;15 5 4 1]; >> min(A) ans =- 5 5- 4 1 >> max(A) ans = 15 13 10 12 >> min(A') ans =- 4- 5 6 1 >> max(A') ans = 12 10 13 15 Problem 2.9 >> A = [3 7- 4 12;- 5 9 10 2;6 13 8 11;15 5 4 1]; >> B = sort(A) B =- 5 5- 4 1 3 7 4 2 6 9 8 11 15 13 10 12 >> C = [sort(A')]' C =- 4 3 7 12- 5 2 9 10 6 8 11 13 1 4 5 15 >> D = sum(A) D = 19 34 18 26 >> E = sum(A') E = 18 16 38 25 2 Problem 2.11 >> A = [3- 2 1;6 8- 5;7 9 10]; >> B = [6 9- 4;7 5 3;- 8 2 1]; >> C = [- 7- 5 2;10 6 1;3- 9 8]; >> D(:,:,1) = A; >> D(:,:,2) = B; >> D(:,:,3) = C; >> max(max(D)) ans(:,:,1) = 10 ans(:,:,2) = 9 ans(:,:,3) = 10 >> max(max(max(D))) ans = 10 The largest element in the first, second, and third layer is 10, 9, and 10 respectively. The largest element inThe largest element in the first, second, and third layer is 10, 9, and 10 respectively....
View Full Document

This note was uploaded on 09/05/2011 for the course EGM 3344 taught by Professor Raphaelhaftka during the Fall '09 term at University of Florida.

Page1 / 9

Solution to HW2 - EGM3344 HW2 Solution Problem 2.3>> x = linspace(0 10 6>> A =[3 x 5 x 20 A = 6 12 18 24 30 20 10 10 20 30 Problem

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online