introduction tointroduction to matlabmicrosoft powerpoint - intro_matlab.pptx author amoses created...
TRANSCRIPT
![Page 1: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/1.jpg)
Introduction to MatlabIntroduction to Matlab
Akiko Sekikawa
![Page 2: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/2.jpg)
MATrix LABoratoryMATrix LABoratoryA numerical computing environment that allows;p g ;
matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces
Where to buy?http://www.mathworks.com/Download software packageDownload software packageOr order DVD
![Page 3: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/3.jpg)
ContentsContents� System requirement and installation� System requirement and installation
� How to load a tab-delimited file (readtext, dlmread)
� How to make a histogram (hist)
� How to make a scatterplot (plot)p (p )
![Page 4: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/4.jpg)
System Requirement- release 2010b operating systems
Windows Mac Linux
Wi d XP S i P k 3 M OS X 10 5 8 (L d) S t dWindows XP Service Pack 3
Windows XP x64 Edition Service Pack 2
Mac OS X 10.5.8 (Leopard) and above
Mac OS X 10.6.x (Snow
Supported distributions
Ubuntu 9.10 and
Windows Server 2003 R2 Service Pack 2
(Leopard) 10.04 LTS
Red Hat Enterprise Linux 5 x and 6 x
Windows Vista Service Pack 1 or 2
Linux 5.x and 6.x
SUSE Linux Enterprise
Windows Server 2008 Service Pack 2 or R2
Windows 7
pDesktop 11.x
Debian 5.xWindows 7
![Page 5: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/5.jpg)
System Requirement- release 2010b
Processors Disk Space RAMAny Intel or AMD x86 processor supporting
1 GB for MATLAB only,3–4 GB for a
1024 MB(At least 2048 MB
SSE2 instruction set(Windows&Linux)
typical installation recommended)
All Intel-based Macs with an Intel Core 2 or later(Mac)
![Page 6: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/6.jpg)
Installation 1Installation 1
After Insertion of the DVD into the DVD drive or downloading the product files from the MathWorks website;
Windows Systems —The installer should start automatically. y y
Linux Systems — For DVD, execute the following command:/path_to_dvd/install &For downloaded files, extract the installer from the archive file and execute the installer command:./install
Macintosh Systems —When the DVD icon appears on the desktop, double-
![Page 7: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/7.jpg)
Installation 2Installation 2Chose if you install using Internety g
![Page 8: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/8.jpg)
Installation 3Installation 3Software License Agreementg
![Page 9: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/9.jpg)
Installation 4Installation 4Log In to Your MathWorks Accountg
![Page 10: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/10.jpg)
Installation 5Installation 5Select the License You Want to Install
![Page 11: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/11.jpg)
Installation 6Installation 6Choose the installation typeyp
![Page 12: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/12.jpg)
Installation 7Installation 7Specify the Installation Folderp y
![Page 13: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/13.jpg)
Installation 8Installation 8Specify Products to Install (Custom Only)p y ( y)
![Page 14: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/14.jpg)
Installation 9Installation 9Complete the Installationp
![Page 15: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/15.jpg)
Getting startedGetting started…
![Page 16: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/16.jpg)
ContentsContentsSystem requirement and installationy q
� How to load a tab-delimited file (readtext, dlmread)dlmread)
� How to make a histogram (hist)
� How to make a scatterplot (plot)
![Page 17: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/17.jpg)
File OperationsFile OperationsWorks in the similar way as Unix systemy y
change directorycdcd
list segments List the folder contents- List the folder contents
ls
![Page 18: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/18.jpg)
![Page 19: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/19.jpg)
How to load atab delimited filestab-delimited files
textread or dlmreadFile with tab-delimited numbers will be read as vectorX = textread(’filename') or X= dlmread(’filename')
![Page 20: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/20.jpg)
![Page 21: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/21.jpg)
ContentsContentsSystem requirement and installationy q
How to load a tab-delimited file (readtext, dlmread)
� How to make a histogram (hist)
� How to make a scatterplot (plot)p (p )
![Page 22: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/22.jpg)
HistogramHistogramFunction: hist
n = hist(Y) bins the elements in vector Y into 10 equally spaced containers.
![Page 23: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/23.jpg)
![Page 24: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/24.jpg)
Histogramti- options
n = hist(Y, nbins)( , )where nbins is a scalar, uses nbins number of bins.Hist(Y, 100) gives;
![Page 25: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/25.jpg)
Histogramti- options
n = hist(Y,x) where x is vector( , )returns the distribution of Y among length(x) bins with centers specified by x.hi t( b) h b 10 0 1 10 ( t f 10 10 1 9 9hist(a, b) where b = -10:0.1:10 (vector of -10, -10.1,…,9.9, 10) gives;
![Page 26: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/26.jpg)
ContentsContentsSystem requirement and installationy q
How to load a tab-delimited file (readtext, dlmread)
How to make a histogram (hist)
� How to make a scatterplot (plot)p (p )
![Page 27: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/27.jpg)
ScatterplotScatterplotFunction: plot (default gives simple line chart)p ( g p )
plot(Y) plots the columns of Y versus the index of each value when Y is a real number.
![Page 28: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/28.jpg)
![Page 29: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/29.jpg)
Scatterplotti- options
Instead of using index, you can have one more vector g , ywith same length to set it as value of another axis.
![Page 30: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/30.jpg)
![Page 31: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/31.jpg)
Scatterplotti- options
Format of data points can also be changedp gplot(X1,Y1,…Xn, Yn, LineSpec)
![Page 32: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/32.jpg)
![Page 33: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/33.jpg)
SummarySummarySystem requirement and installationy q
How to load a tab-delimited file (readtext, dlmread)
How to make a histogram (hist)
How to make a scatterplot (plot)
If you are stuck with usage of functionsIf you are stuck with usage of functions…help function name
![Page 34: Introduction toIntroduction to MatlabMicrosoft PowerPoint - Intro_matlab.pptx Author Amoses Created Date 2/3/2011 10:18:49 AM](https://reader033.vdocuments.us/reader033/viewer/2022043000/5f755d052882681a913ed4f6/html5/thumbnails/34.jpg)