107hw4

107hw4 - MAE 107 - Homework # 4 Numerical Methods in...

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

View Full Document Right Arrow Icon
MAE 107 - Homework # 4 Numerical Methods in Engineering Prof. Alison Marsden Due date: Friday April 29, 2011 Problem 1 - (MATLAB) See the structure of a matrix: Create a 20 × 20 matrix with command A = ones(20) . Now replace the 10 × 10 submatrix between rows 6 : 15 and columns 6 : 15 with zeros. See the structure of the matrix (in terms of nonzero entries with the command spy(A) . Set the 5 × 5 submatrices in the top right corner and bottom left corner to zeros and see the structure again. Problem 2 - (MATLAB) Do some cool operations: Create a 10 × 10 random matrix with the command A = rand(10) . Now do the following operations. Multiply all elements by a 100 and then round off all elements of the matrix to integers with the command A=fix(A) . Replace all elements of A < 10 with zeros. Replace all elements of A > 90 with infinity ( inf ). Extract all 30 a ij 50 in a vector b , that is, find all elements of A that are between 30 and 50 and put them in a vector
Background image of page 1

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

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

Page1 / 3

107hw4 - MAE 107 - Homework # 4 Numerical Methods in...

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

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