Presentation is loading. Please wait.

Presentation is loading. Please wait.

2.1 MATLAB 환경 2.2 배정 2.3 수학적 연산 2.4 내장함수의 사용 2.5 그래픽 2.6 다른 자원

Similar presentations


Presentation on theme: "2.1 MATLAB 환경 2.2 배정 2.3 수학적 연산 2.4 내장함수의 사용 2.5 그래픽 2.6 다른 자원"— Presentation transcript:

1 2.1 MATLAB 환경 2.2 배정 2.3 수학적 연산 2.4 내장함수의 사용 2.5 그래픽 2.6 다른 자원

2 2.1 MATLAB 환경 명령창 그래프창 편집창 >> (명령어 길잡이) >> 55 - 16 ans =
명령창  - 명령을 입력하는 창 그래프창 - 그래프를 나타내는 창 편집창   - M-파일을 편집하는 창 >>  (명령어 길잡이) >>  ans =          39 >> ans + 11          50 2장 MATLAB 기초

3 2.1 MATLAB 환경 2장 MATLAB 기초

4 2.2 배정 (1/10) [스칼라] >> a = 4 a = 4 >> A = 6;
       4 >> A = 6; >> a =4, A=6; x= 1; >> x x =        1 2장 MATLAB 기초

5 2.2 배정 (2/10) [스칼라] 복소수 >> x = 2 + i*4 x = 2.0000 + 4.0000i
>> x = 2 + j*4 2장 MATLAB 기초

6 2.2 배정 (3/10) [스칼라] 포맷 형태 >> pi ans = 3.1416
     3.1416 >> format long  (15자리 유효숫자)     >> format short  (소수점 이하4자리)    3.1416 2장 MATLAB 기초

7 2.2 배정 (4/10) [배열, 벡터와 행렬] >> a = [ 1 2 3 4 5] a = 1 2 3 4 5
>> b = [2; 4; 6; 8; 10] 열벡터 b = 2 4 6 8 10 2장 MATLAB 기초

8 2.2 배정 (5/10) [배열, 벡터와 행렬] >> A = [1 2 3; 4, 5, 6; 7 8 9] A =
>> who Your variables are: A a ans b x 2장 MATLAB 기초

9 2.2 배정 (6/10) [배열, 벡터와 행렬] >> whos Name Size Bytes Class
A x double array a x double array ans x double array b x double array x x double array (complex) Grand total is 21 elements using 176 bytes 2장 MATLAB 기초

10 2.2 배정 (7/10) [배열, 벡터와 행렬] >> b(4) ans = 8 >> A(2,3) 6
>> E=zeros(2,3) E = A = b = 2 4 6 8 10 2장 MATLAB 기초

11 2.2 배정 (8/10) [콜론 연산자] >> t = 1:5 t = 1 2 3 4 5
>> t = 1:0.5:3 >> t = 10: -1:5 2장 MATLAB 기초

12 2.2 배정 (9/10) [콜론 연산자] >> A(2,:) ans = 4 5 6 >> t(2:4)
>> t(2:4) A = t = 2장 MATLAB 기초

13 2.2 배정 (10/10) [linspace와 logspace 함수 ] >> linspace(0,1,6) ans =
>> logspace(-1,2,4) 2장 MATLAB 기초

14 2.3 수학적 연산 (1/7) [계산순서] 지수계산 (^) 음부호 (-) 곱셈과 나눗셈 (*, /) 왼쪽 나눗셈 (\)
덧셈과 뺄셈 (+, -) 2장 MATLAB 기초

15 2.3 수학적 연산 (2/7) >> 2*pi ans = 6.2832 >> y=pi/4;
0.5533 >> y=-4^2 y = -16 2장 MATLAB 기초

16 2.3 수학적 연산 (3/7) >> y=(-4)^2 y = 16 >> x=2+4i x =
ans = i >> 1/x i 2장 MATLAB 기초

17 2.3 수학적 연산 (4/7) >> x^2 ans = -12.0000 +16.0000i >> x+y
>> b=[4 5 6]'; >> A=[1 2 3; 4 5 6; 7 8 9]; x = i y = 16 2장 MATLAB 기초

18 2.3 수학적 연산 (5/7) >> a*A ans = 30 36 42 >> A*b 32 77 122
>> A*b 32 77 122 >> A*a ??? Error using ==> * Inner matrix dimensions must agree. a = b = 4 5 6 A = 2장 MATLAB 기초

19 2.3 수학적 연산 (6/7) >> A*A ans = 30 36 42 66 81 96 102 126 150
>> A/pi A = 2장 MATLAB 기초

20 2.3 수학적 연산 (7/7) >> A^2 행렬의 곱 ans = 30 36 42 66 81 96
>> A.^2 원소별 거듭제곱 A = 2장 MATLAB 기초

21 2.4 내장함수의 사용 (1/9) Help 명령어를 사용하여 온라인 도움을 얻음 >> help log
LOG Natural logarithm. LOG(X) is the natural logarithm of the elements of X. Complex results are produced if X is not positive. See also LOG2, LOG10, EXP, LOGM. 2장 MATLAB 기초

22 2.4 내장함수의 사용 (2/9) >> help elfun (모든 내장 함수를 볼 수 있음)
Elementary math functions. Trigonometric. sin Sine. sinh Hyperbolic sine. asin Inverse sine. asinh Inverse hyperbolic sine. cos Cosine. 2장 MATLAB 기초

23 2.4 내장함수의 사용 (3/9) >> help elfun (모든 내장 함수를 볼 수 있음) Exponential.
exp Exponential. log Natural logarithm. log Common (base 10) logarithm. sqrt Square root. 2장 MATLAB 기초

24 2.4 내장함수의 사용 (4/9) >> help elfun (모든 내장 함수를 볼 수 있음) Complex.
abs Absolute value. angle Phase angle. complex - Construct complex data from real and imaginary parts. 2장 MATLAB 기초

25 2.4 내장함수의 사용 (5/9) >> help elfun (모든 내장 함수를 볼 수 있음)
Rounding and remainder. fix Round towards zero. floor Round towards minus infinity. ceil Round towards plus infinity. round Round towards nearest integer. mod Modulus (signed remainder after division). rem Remainder after division. sign Signum. 2장 MATLAB 기초

26 2.4 내장함수의 사용 (6/9) >> sin(pi/2) ans = 1 >> exp(1) 2.7183
>> abs(1+2i) 2.2361 >> fix(1.9) : FIX(X) rounds the elements of X to the nearest integers towards zero. 2장 MATLAB 기초

27 2.4 내장함수의 사용 (7/9) >> ceil(1.9) ans = 2 >> round(1.9)
>> rem(7,3) : remainder after division 1 >> log(A) A = 2장 MATLAB 기초

28 2.4 내장함수의 사용 (8/9) >> t=[0:2:20]' t = 2 4 6 8 10 12 14 16 18 20
2 4 6 8 10 12 14 16 18 20 >> length(t) ans = 11 2장 MATLAB 기초

29 2.4 내장함수의 사용 (9/9) >> g=9.81; m=68.1; cd=0.25;
>> v=sqrt(g*m/cd)*tanh(sqrt(g*cd/m)*t) v = 2장 MATLAB 기초

30 2.5 그래픽 (1/2) 그래프를 빠르고 편리하게 그릴 수 있음 >> plot(t,v)
>> title('Plot of v versus t') >> xlabel('Value of t') >> ylabel('Value of v') >> grid 2장 MATLAB 기초

31 2.5 그래픽 (2/2) 그래프를 빠르고 편리하게 그릴 수 있음 >> plot(t,v)
>> title('Plot of v versus t') >> xlabel('Value of t') >> ylabel('Value of v') >> grid >> plot(t,v,'bo:') % blue dotted line with circles on it (표 2.2 참조) 2장 MATLAB 기초


Download ppt "2.1 MATLAB 환경 2.2 배정 2.3 수학적 연산 2.4 내장함수의 사용 2.5 그래픽 2.6 다른 자원"

Similar presentations


Ads by Google