Operator

clc
- Interpreter initialization, help <함수>
- 설명

Calculation

Variable

Trigonometric function

Graph plot
1 2 3 4 5 6 7
| grid on bar(b) xlabel('name') ylabel('name') plot(b,'*') plot(b, '+') axis([0 10 0 10])
|



Text and Charaters

Array
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| >> magic(4)
ans =
16 2 3 13 5 11 10 8 9 7 6 12 4 14 15 1
>> help magic magic - 마방진(Magic Square)
행과 열의 합계가 동일하고 1 ~ n2 범위의 정수로 생성된 nxn 행렬을 반환합니다.
M = magic(n)
참고 항목 ones, rand
magic에 대한 함수 도움말 페이지
>> ans(4,2)
ans =
14
>> a=magic(4)
a =
16 2 3 13 5 11 10 8 9 7 6 12 4 14 15 1
>> a(3,:)
ans =
9 7 6 12
>> a(1:3,2)
ans =
2 11 7
|
:
는 from to
의 의미를 지님
Example

1 2
| a=[[1,2,3];[4,5,6];[7,8,9]] b=[1 2 3;4 5 6;7 8 9]
|

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| >> A = [1 2 0; 2 5 -1; 4 10 -1]
A =
1 2 0 2 5 -1 4 10 -1
>> B=A'
B =
1 2 4 2 5 10 0 -1 -1
>> C=A*B
C =
5 12 24 12 30 59 24 59 117
>> C=A.*B
C =
1 4 0 4 25 -10 0 -10 1
|

