14
Lecture 5 コンピュータその5 1 1. MATLAB Tuesday, November 1, 16

Lecture 5 1. MATLABmmc01.es.hokudai.ac.jp/~eginder/courses/computer/lec/Lec...Lecture 5 コンピュータその5 1 1. MATLAB Tuesday, November 1, 16 2 MATLAB tutorial 1. プロンプト

  • Upload
    others

  • View
    9

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Lecture 5 1. MATLABmmc01.es.hokudai.ac.jp/~eginder/courses/computer/lec/Lec...Lecture 5 コンピュータその5 1 1. MATLAB Tuesday, November 1, 16 2 MATLAB tutorial 1. プロンプト

Lecture 5

コンピュータその51

1. MATLAB

Tuesday, November 1, 16

Page 2: Lecture 5 1. MATLABmmc01.es.hokudai.ac.jp/~eginder/courses/computer/lec/Lec...Lecture 5 コンピュータその5 1 1. MATLAB Tuesday, November 1, 16 2 MATLAB tutorial 1. プロンプト

2

MATLAB tutorial

1.

プロンプトワークスペースWorking directory

Matrix Laboratoryインタプリタ形式の高性能なテクニカルコンピューティング言語

Tuesday, November 1, 16

Page 3: Lecture 5 1. MATLABmmc01.es.hokudai.ac.jp/~eginder/courses/computer/lec/Lec...Lecture 5 コンピュータその5 1 1. MATLAB Tuesday, November 1, 16 2 MATLAB tutorial 1. プロンプト

3

>> 5+5

プロンプト

MATLAB tutorial

Tuesday, November 1, 16

Page 4: Lecture 5 1. MATLABmmc01.es.hokudai.ac.jp/~eginder/courses/computer/lec/Lec...Lecture 5 コンピュータその5 1 1. MATLAB Tuesday, November 1, 16 2 MATLAB tutorial 1. プロンプト

4

>> x = 5+5;

プロンプト

MATLAB tutorial

>> x

>> sin(x) % this is a comment

1.

2.

3.

>> edit matlab_introduction.m4.

Tuesday, November 1, 16

Page 5: Lecture 5 1. MATLABmmc01.es.hokudai.ac.jp/~eginder/courses/computer/lec/Lec...Lecture 5 コンピュータその5 1 1. MATLAB Tuesday, November 1, 16 2 MATLAB tutorial 1. プロンプト

5

The MATLAB editor

Tuesday, November 1, 16

Page 6: Lecture 5 1. MATLABmmc01.es.hokudai.ac.jp/~eginder/courses/computer/lec/Lec...Lecture 5 コンピュータその5 1 1. MATLAB Tuesday, November 1, 16 2 MATLAB tutorial 1. プロンプト

6

The MATLAB editor

>> matlab_introduction2.

プロンプト

Tuesday, November 1, 16

Page 7: Lecture 5 1. MATLABmmc01.es.hokudai.ac.jp/~eginder/courses/computer/lec/Lec...Lecture 5 コンピュータその5 1 1. MATLAB Tuesday, November 1, 16 2 MATLAB tutorial 1. プロンプト

7

MATLAB control structures

>> matlab_introduction3.

?

プロンプト

Tuesday, November 1, 16

Page 8: Lecture 5 1. MATLABmmc01.es.hokudai.ac.jp/~eginder/courses/computer/lec/Lec...Lecture 5 コンピュータその5 1 1. MATLAB Tuesday, November 1, 16 2 MATLAB tutorial 1. プロンプト

8

MATLAB control structures

>> matlab_introduction4.

?

プロンプト

Tuesday, November 1, 16

Page 9: Lecture 5 1. MATLABmmc01.es.hokudai.ac.jp/~eginder/courses/computer/lec/Lec...Lecture 5 コンピュータその5 1 1. MATLAB Tuesday, November 1, 16 2 MATLAB tutorial 1. プロンプト

9

MATLAB control structures

>> matlab_introduction5.

?

プロンプト

Tuesday, November 1, 16

Page 10: Lecture 5 1. MATLABmmc01.es.hokudai.ac.jp/~eginder/courses/computer/lec/Lec...Lecture 5 コンピュータその5 1 1. MATLAB Tuesday, November 1, 16 2 MATLAB tutorial 1. プロンプト

10

MATLAB 配列(arrays)

>> matlab_introduction6.

?

プロンプト

Tuesday, November 1, 16

Page 11: Lecture 5 1. MATLABmmc01.es.hokudai.ac.jp/~eginder/courses/computer/lec/Lec...Lecture 5 コンピュータその5 1 1. MATLAB Tuesday, November 1, 16 2 MATLAB tutorial 1. プロンプト

11

MATLAB functions

>> matlab_introduction7.

?

プロンプト

Tuesday, November 1, 16

Page 12: Lecture 5 1. MATLABmmc01.es.hokudai.ac.jp/~eginder/courses/computer/lec/Lec...Lecture 5 コンピュータその5 1 1. MATLAB Tuesday, November 1, 16 2 MATLAB tutorial 1. プロンプト

12

MATLAB functions

>> matlab_introduction8.

?

プロンプト

Tuesday, November 1, 16

Page 13: Lecture 5 1. MATLABmmc01.es.hokudai.ac.jp/~eginder/courses/computer/lec/Lec...Lecture 5 コンピュータその5 1 1. MATLAB Tuesday, November 1, 16 2 MATLAB tutorial 1. プロンプト

13

Brownian motion (random walk in 1d)

??????

Hint: >> rand

9.

Tuesday, November 1, 16

Page 14: Lecture 5 1. MATLABmmc01.es.hokudai.ac.jp/~eginder/courses/computer/lec/Lec...Lecture 5 コンピュータその5 1 1. MATLAB Tuesday, November 1, 16 2 MATLAB tutorial 1. プロンプト

14

Brownian motion (random walk in 2d)

??????

??????

10.

Tuesday, November 1, 16