Lecture4 - Lecture 4: More on manipulating arrays Cinna...

Info iconThis preview shows pages 1–5. 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: Lecture 4: More on manipulating arrays Cinna (see-na) Wu cinnawu@math.berkeley.edu Modified from slides by Ryan Hynd Department of Mathematics University of California, Berkeley Math 98 Introduction to MATLAB programming Announcements HW 2 Posted : http://math.berkeley.edu/ cinnawu/math98HW2.pdf. Array initialization The many ways.... [- 1 0; 2 ; 1 / 2 i ] is the 3 2 matrix - 1 2 1 / 2 i zeros ( m,n ) outputs the m n matrix of all 1s. ones ( m,n ) outputs the m n matrix of all 0s. rand ( m,n ) outputs an m n matrix where each entry is a uniformly distributed number between 0 and 1. randn ( m,n ) outputs an m n matrix where each entry is an N (0 , 1) distributed number. eye ( n ) outputs the n n identity matrix Exercise Is there an analog of the linspace command of matrices? Search for meshgrid under the help. Accessing array entries Note: There are arrays of any dimension. However, we will only focus one one-dimensional (vectors) and two-dimensional arrays...
View Full Document

This note was uploaded on 01/21/2012 for the course MATH 98 taught by Professor Instuctor during the Spring '08 term at University of California, Berkeley.

Page1 / 9

Lecture4 - Lecture 4: More on manipulating arrays Cinna...

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

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