csc115: matlab special session
DESCRIPTION
CSC115: Matlab Special Session. Dr. Zhen Jiang Computer Science Department West Chester University. Class information. Textbook Hanselman & Littlefield, “Mastering Matlab 7”, Prentice Hall, Upper Saddle River, NJ, 2005. Example on Page 6 Variable Keyword (reserved word) ; - PowerPoint PPT PresentationTRANSCRIPT
CSC115: Matlab Special SessionDr. Zhen JiangComputer Science DepartmentWest Chester University
Class informationTextbook
◦Hanselman & Littlefield, “Mastering Matlab 7”, Prentice Hall, Upper Saddle River, NJ, 2005.
Example on Page 6◦Variable◦Keyword (reserved word)◦;◦Calculation◦% (comment)◦,◦error
<File> <new>Or the direct access from the
icon “blank”
Input / OutputParameter input Page 33
Xls input (the easiest one)◦Sample xls input file
Page 250Also available at
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/xlsread.html
Something must knowPage 39
◦How to use the readout n?
Apply an operation on every unit in the array
Page 47` (especially useful to handle
different input format, see the discussion later)
Standard arrays, page 54◦Ones, zeros, size, eye, rand, randn,
diag◦Repmat(pi, 3, 4)
Array sorting, search, page 73
Find(a>4, 2, ‘first’)◦Page 189, such as a filter to discard
NaN or InFMaxMinSize
Manipulation * , page 82 (optional)
Multidimensional array◦1-d => 2-d => 3-d, page 98◦3-d => 2-d => 1-d, page 99◦Reshape(page 57), cat(page 101),
flipdim, shiftdim, permute◦Their search and sorting, such as a
3d array sorted in one dimension.
[p, q]◦[ p q ]◦Or cat (2, p, q)
[p; q]◦Or cat (1, p, q)
Output◦Standard output◦Disp(), page 162◦Sprintf, page 168◦Plot, page 276
Other inputs◦Sample plain text file
Help fileformats, page 253Tip: Try to avoid using low level
file I/O