DOC PREVIEW
Johns Hopkins EN 600 461 - Matlab Notes

This preview shows page 1 out of 4 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Matlab NotesGregory D. HagerComputer Vision (CS 461)Matlab Basics• Starting, stopping, help, demos, math, & variables• Matrix definition and indexing> > A = [ 1 2 3 ; 4 5 6 ; 7 8 9 ] or1 2 34 5 67 8 9> > A(3,2)> > A(3,:)> > A(3,1:2) = [ 0 0 ]> > A’> > A(2,:) = A(:,1)’> > size(A)Matlab Built-Ins• for! if! while! switch "" execution control• who! whos! clear "" variable listing and removing• save! load #file$ "" saving or restoring a workspace• diary #file$ "" start recording to a file• path! addpath "" display or add to search path• close! close all! clc "" close windows, clear console• double vs. uint% "" data casting functions• zeros&x!y!…' -- creates an all-zero x by y … matrixdiary off ; diary onused for basic memory allocationImages in Matlab (& Functions)Images in Matlab are really matrices. The image toolboxis a special set of functions for representing matrices.Images are either stored as uint (typically 0 to 255) oras doubles (typically ranging from 0 to 1). Take care to normalize images to this range (some functions dothis automatically).Color images are three-dimensional matrices indexed asrow, column, image-bandImages in Matlab (& Functions) Built-in functions:A (imread&#filename$! #type$' "" pull from fileimwrite&A! #filename$! #type$' "" write to fileimagesc&A' "" display imageimshow(A) --- better way to display’tif’’jpg’’bmp’’png’’hdf’’pcx’’xwd’single-quoted stringsTypesImage MatrixMatlab matrix AA(1:10,1:10,:)The large “M”A(200, 50:300, 3)The spam’s locationsize(A)Matlab Built-InsSee the CS153 reference page for more matlab links.• F ( fft)&A' "" Fourier transform: F is A’s frequencies• A ( ifft)&F' "" inverse Fourier: A is F’s image• F) ( fftshift&F' "" places the coordinate system at center• diary #file$ "" start recording to a file• keyboard "" give control back to user until return• double vs. uint% "" data casting functions• zeros&x!y!…' -- creates an all-zero x by y … matrixdiary off ; diary onused for basic memory


View Full Document

Johns Hopkins EN 600 461 - Matlab Notes

Download Matlab Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Matlab Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Matlab Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?