MATLAB &aelig;•&deg;&aring;&shy;&brvbar;&aring;&middot;&yen;&aring;…&middot;&egrave;&frac12;&macr;&a

# MATLAB æ•°å­¦å·¥å…·è½¯&a

This preview shows pages 1–10. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 MATLAB 2 MATLAB MALAB MATrix LABoratory LINPACK EISPACK MATLAB Ax=b MATLAB A*x=b A,b x x=A\b MATLAB C Fortran MATLAB MATLAB toolbox MATLAB Control Toolbox (Signal Processing Toolbox) (Communication Toolbox) MATLAB MATLAB MATLAB MATLAB MATLAB MATLAB 2.1 MATLAB MATLAB quit MATLAB clc MATLAB clf MATLAB clear pack dir cd disp type echo 3 hold MATLAB MATLAB 5 1 3 2 + ) . sin( π 2*sin(0.3*pi)/(1+sqrt(5)) [Enter] , ans = 0.5000 ↑ Home ↓ End ← Delete → Backspa ce PageUp Esc PageDo wn 2.2 MATLAB MATLAB [ ] [ 1] A=[1,2,3;4,5,6;7,8,9;10,11,12] A = 1 2 3 4 5 6 7 8 9 10 11 12 A MATLAB Workspace clear MATLAB [ 2] A=[1 2 3 4 5 6 7 8 0 1 2 3] A = 1 2 3 4 5 6 7 8 4 0 1 2 3 [ 3] B(1,2)=3;B(4,4)=6;B(4,2)=11 B = 0 3 0 0 0 0 0 0 0 0 11 0 6 2.3 MATLAB MATLAB MATLAB 1 2 = 1 2 ans ans 3 4 = + * 5 19 MATLAB [ 1] 2001/81 ans = 24.7037 [ 2] s=1-1/2+1/3-1/4+1/5-1/6+1/7-1/8; s s s s = 0.6345 2.4 Who Whos Who Whos MATLAB Whos [ 1] who who Your variables are: s [ 2] whos whos Name Size Bytes Class s 1x1 8 double array Grand total is 1 elements using 8 bytes 5 MATLAB Permanent variables Predefined variables eps pc 52 2 − pi π 3.14159265358979 inf Inf NaN i,j 1 − = = j i flops 1 MATLAB 2 clear 3 clear [ 1] s=1/0 Warning: Divide by zero. s = Inf a=Inf/inf a = NaN 2.5 MATLAB 3 -99 0.0013 9.2445154 1.2434e-6 4.673e33 IEEE eps 16 308 308 10 1 10 1 × × − ~ + * / \ ^ [ 1] x=2*pi/3+2^3/5-0.3e-3 x = 3.6941 2.6 MATLAB i j 6 [ 1] z1=3+4*i,z2=2*exp(i*pi/6) z=z1*z2 z1 = 3.0000 + 4.0000i z2 = 1.7321 + 1.0000i z = 1.1962 + 9.9282i [ 2] A=[1,3;2,4]-i*[5,8;6,9] B=[1+5*i,2+6*i;3+8*i,4+9*i] C=A*B A = 1.0000 - 5.0000i 3.0000 - 8.0000i 2.0000 - 6.0000i 4.0000 - 9.0000i B = 1.0000 + 5.0000i 2.0000 + 6.0000i 3.0000 + 8.0000i 4.0000 + 9.0000i C = 1.0e+002 * 0.9900 1.1600 - 0.0900i 1.1600 + 0.0900i 1.3700 2.7 MATLAB 1 2 M 3 MATLAB z z z z z z z z z z z [ ] z=1233.344 x=sqrt(log(z)) z = 7 1.233344000000000e+003 x = 2.66786140168028 2.8 MATLAB short MATLAB format MATLAB short 5 [ ] x=[4/3 1.2345e-6] short x = 1.3333 0.0000 format short e x x = 1.3333e+000 1.2345e-006 format long x x = 1.33333333333333 0.00000123450000 format long e x x = 1.333333333333333e+000 1.234500000000000e-006 format bank x x = 1.33 0.00 format hex x x = 3ff5555555555555 3eb4b6231abfd271 format + + + x x =++ format compact( ) 2.9 quit exit MATLAB MATLAB 8 1 save matlab.mat 2 save [ ] [ ] save temp x y z x,y,z temp.mat MATLAB load 1 load matlab.mat MATLAB 2 load [ ] [ ] MATLAB load temp x temp.mat x MATLAB 2.10 MATLAB MATLAB MATLAB [ 1] t=0:pi/50:4*pi; y0=exp(-t/3); y=exp(-t/3).*sin(3*t); plot(t,y,t,y0,t,-y0) grid 2 4 6 8 10 12 14-1-0.8-0.6-0.4-0.2 0.2 0.4 0.6 0.8 1 [ 2] x=-8:0.5:8; y=x'; X=ones(size(y))*x; Y=y*ones(size(x)); R=sqrt(X.^2+Y.^2)+eps; Z=sin(R)./R; mesh(Z); colormap([1,0,0]) 9 2.11 lp lookfor MATLAB 1 MATLAB help windows 2 MATLAB (i)help MATLAB help HELP topics: matlab\general - General purpose commands....
View Full Document

## This note was uploaded on 10/17/2010 for the course ANY 082501 taught by Professor Wuli during the Spring '01 term at Zhejiang University.

### Page1 / 72

MATLAB æ•°å­¦å·¥å…·è½¯&a

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online