Download presentation
Presentation is loading. Please wait.
Published byAvice Wilson Modified over 9 years ago
1
1 Beyond Basics Ⅱ Complex Arithmetic More on Matrices Doing Calculus whit Matlab Jae Hoon Kim Department of Physics Kangwon National University
2
2 Complex Arithmetic Matlab 에서 복소수는 'i' 를 사용하여 나타낸다. >> solve('x^2 + 2*x + 2 = 0') ans = [-1+i] [-1-i] >> (2 + 3*i)*(4 - i) ans = 11.0000 + 10.0000i
3
3 More on Matrices Element-by-element operation >> A.*B (element-by-element product) >> A./B (element-by-element quotient) A : vector >> A.^C (raising each of the elements) B&C :vector or scalar submatrice 구하기 ① >> a(4,[1 2]) ans = 12 ② >> a(2:3,2:4) ans = 324 110
4
4 Special Matrices >> zeros(2,3) ( 모든 element 가 0 인 행렬 ) ans = 000 >> ones(2,3) ( 모든 element 가 1 인 행렬 ) ans = 111 >> eyes(3) ( 단위 행렬 ) ans = 100 010 001
5
5 solving Linear Systems 연립일차방정식의 풀이 2x+3y=2 x+2y=3 >> A=[2 3;1 2] A = 2 3 1 2 >> b=[2; 3] b = 2 3 >> x=A\b ( 행렬의 오른쪽 나눗셈 ('/'), 행렬의 왼쪽 나눗셈 (' \ ')) x = -5 4
6
6 calculating Eigenvalues and Eigenvectors >> A = [3 -2 0; 2 -2 0; 0 1 1]; >> eig (A) ( 행렬 A 의 eigenvalues 값을 구한다 ) ans = 1 2 >> [U, R] = eig(A) (U 는 eigenvectors 값을 R 에는 eigenvalues 값을 출력함 ) U = 0-0.4082 -0.8165 0-0.8165 -0.4082 1.0000 0.4082 -0.4082 R = 100 0-10 002
7
7 Doing Calculus whit MATLAB Differentiation >> syms x; diff(x^3) ans = 3*x^2 >> f = inline('x^3', 'x'); diff(f(x)) ans = 3*x^2 >> diff(f(x), 2) (2 차 미분 ) ans= 6*x 미분방정식 풀이 xy'+1 =y >>dsolve('x*Dy + 1 = y', 'x') ans= 1+x*C1
8
8 Integration ( 부정적분 ) >> int('x^2', 'x') ans = 1/3*x^3 ( 정적분 ) >>syms x; int(asin(x), 0, 1) ans = 1/2*pi-1 ( 수치적분 ) >>quadl('exp(-x.^4)', 0, 1) ans = 0.8448 ( 이중 적분 ) >> syms x y; int(int(x^2+y^2, y, 0, sin(x)), 0, pi) ans = pi^2-32/9
9
9 Limits >> limit(abs(x)/x, x, 0, 'left') (left: 좌극한 right: 우극한 abs: 절대값 ) ans = >>limit(abs(x)/x, x, inf) (inf: 무한대 ) ans = 1
10
10 Sums and Products >> x = 1:7; >> sum(x) ans = 28 >> prod(x) ans = 5040 >> syms k n; symsum(1/k-1/(k+1), 1,n) ans = -1/(n+1)+1 >>syms n; symsum(1/n^2, 1, inf) ans = 1/6*pi^2 (finite symbolic sum) (infinite symbolic sum)
11
11 Taylor Series >> syms x; taylor(sin(x), x, 10) (sinx 를 x 에 대하여 10 차 항까지 전개 ) ans = x-1/6*x^3+1/120*x^5-1/5040*x^7+1/362880*x^9
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.