U E D R , A S I H C RSS

MachineLearning스터디/Octave (rev. 1.15)

Machine Learning스터디/Octave


2. 기본 산술, 논리 연산

Elementary_Operation.PNG
[PNG image (5.2 KB)]

  • ~= : not equal
  • false : 0
  • true : 1

3. 행렬 만들기

 A = [1 2; 3 4; 5 6]
Matrix1.PNG
[PNG image (581 Bytes)]

  • ;는 다음 행으로 넘어간다는 표시


  •  A = 1:0.1:2
    
    matrix2.PNG
    [PNG image (3.06 KB)]



     A = ones(1, 3)
     B = zeros(2, 3)
    
    Matrix3.PNG
    [PNG image (2.07 KB)]



     eye (2)
    
    eyem.png
    [PNG image (945 Bytes)]

  • identity matrix를 만들어 줌.

  • 4. 행렬 크기


    4.1. size


     size([1; 2; 3; 4])
    
     * 결과
    
     ans = 
    
         4    1
    
     4 rows 1 column
    

    4.2. length


     length([3 2; 2 3; 1 3])
    
     * 결과
     ans = 3
    
    • 행렬의 열과 행의 길이 중에 큰 값이 나옴.


    5. 기타 함수

     
     w = -6 + sqrt(10) * (randn(1, 10000))
     hist(w)
    
    • hist(w) : w에 대한 histogram을 보여줌.


     help
    
    • 도움말

    Valid XHTML 1.0! Valid CSS! powered by MoniWiki
    last modified 2021-02-07 05:23:42
    Processing time 0.0165 sec