1、Matlab,Week 1,Why compute? What is Matlab? Why matrix? History of Matlab Strength of Matlab Weakness of Matlab Competitors Matlab Demo Tasks for Lab 1,Why compute?,Digital vs analog- number crunching power Solve x2=2- need numeric solutions Once upon a time, there is a cow - need computable solution
2、s Van Gogh vs Picasso- abstract yet practical,What is Matlab?,Matrix Laboratory Calculator Interactive Programming language Scientific computation and visualization tool Symbolic computing tool,MATRIX,Why Matrix?,History of Matlab,Developed by Cleve Moler in Stanford in 70s To facilitate matrix and
3、vector computations Easier to program than Fortran Spread by word of mouth Mathworks, Inc established in 1984http:/ of Matlab,Easy to learn Vector formulation instead of scalar Programmable calculator Interpreter, not compiler - easy to debug Powerful graphics Add-in toolboxes 1,000,000+ user commun
4、ity - freeware,2D graphics,Polar plot: t=0:.01:2*pi; polar(t,abs(sin(2*t).*cos(2*t);,Line plot: x=0:0.05:5; y=sin(x.2); plot(x,y);,Stem plot: x = 0:0.1:4; y = sin(x.2).*exp(-x); stem(x,y),Mesh plot: z=peaks(25); mesh(z);,Surface plot:z=peaks(25); surf(z);,Contour plot:z=peaks(25); contour(z,16);,Sph
5、erical harmonic: spharm2,3D graphics,Weakness of Matlab,Interpreter slower than compilers Clumsy in handling texts Finite-precision arithmetic Expensive scilab project,Competitors,Scilab Matlab emulatordevelop jointly by Chinese and French Governments Octave Matlab emulatordeveloped by Wisconsin U M
6、athematica symbolic computation Maple symbolic computationincorporated in Matlab,Matlab Demo,Illustrates the easy and powerful aspects of Matlab Consists of two partsi. Core Matlabii. Toolboxes Core Matlab desktop, matrices, graphics Toolboxes financial, symbolic,To use:i. Programs = Matlab = Matlab
7、 7ii. Inside Matlab window, look for Matlab prompt “” iii. Type “demo” and hit “Enter” key iv. On left panel, click “+” on MATLABv. Click “+” on any one of the foldersvi. Click on any one of the examplesEnjoy!,Matlab Desktop,Command Window,Launch Pad,History,Command Window,Workspace,Current DIrector
8、y,difference,Tasks for Lab 1,To explore strange new world of computing, to seek out where no other programming languages have gone before Witness different kinds of computational problems in the real world Appreciate their easy solutions by Matlab And most of all, search and have fun.,The figure on the right is a bar plot of a bell-shaped curve. Find the Matlab command(s) in Demo for generating it?,Expected answer:x = -2.9:0.2:2.9;bar(x,exp(-x.*x);,You will have to answer questions like the following one in Lab Assignment 1.,