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 10: Miscellaneous topics Cinna Wu [email protected] Department of Mathematics University of California, Berkeley Math 98 Introduction to MATLAB programming Announcements HW 4 Solutions are up HW 5 (optional if you have passed four assignments) is up. HW 5 must be in to me by Thursday 10/6/11. Put HW in my mailbox on the 9th floor of Evans hall. Labeled C. Wu MATFiles save save saves the contents of a MATLAB variable to a MATfile. The file are saved to the current directory (use the dir command to check the current directory). For example, >>x=randn(1,2) >> 0.1253 0.2877 >> save sample x; Example In the following code, use save to save the 20th matrix as mat20. v = zeros(100,1); for i = 1 : 100 A = randn(10,10); v(i) = trace(A); end Using the append option, add a description of the matrix to mat20.mat. MATFiles load load allows you to load the contents of a MATfile. For example, >> clear x >> load sample.mat; >> x >> 0.1253 0.2877 Options for load and save save all, save filename x y z, save filename x append, load filename x Lookup tables...
View
Full Document
 Spring '08
 Instuctor
 matlab, current directory, Fibonacci number, Lookup table, Vector Pascal Rule

Click to edit the document details