This preview shows pages 1–5. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Lecture 4: More on manipulating arrays Cinna (seena) 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 onedimensional (vectors) and twodimensional 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.
 Spring '08
 Instuctor
 matlab

Click to edit the document details