• Tidak ada hasil yang ditemukan

Session IV Graphs & Matrices

N/A
N/A
Protected

Academic year: 2025

Membagikan "Session IV Graphs & Matrices"

Copied!
40
0
0

Teks penuh

(1)

*

Session IV

Graphs & Matrices

Dr. Afsaneh Mojra

Dept of Mechanical Engineering

(2)

Homework

تﻻدﺎﻌﻣ ﺪﻴﻨﻛ ﻢﻴﺳﺮﺗ ار ﺮﻳز

:

1/39

(3)

Homework

Session4: Programming Dr. Afsaneh Mojra

تﻻدﺎﻌﻣ ﺪﻴﻨﻛ ﻢﻴﺳﺮﺗ ار ﺮﻳز

:

2/39

(4)

Homework

0 1 2 3 4 5 6 7 8 9 10

1.5 2 2.5 3 3.5 4 4.5 5 5.5 6

x

y

data 1

3/39

(5)

Homework

Session4: Programming Dr. Afsaneh Mojra

تﻻدﺎﻌﻣ ﺪﻴﻨﻛ ﻢﻴﺳﺮﺗ ار ﺮﻳز

:

4/39

(6)

Homework

0 1 2 3 4 5 6 7 8 9 10

-40 -30 -20 -10 0 10 20

5/39

(7)

Plot

Session4: Programming Dr. Afsaneh Mojra

Graph )

يﺪﻌﺑ ود

( 2-D

يا ﻪﻠﻴﻣ رادﻮﻤﻧ (Bar Plot) ﺎﻄﺧ رادﻮﻤﻧ (Error Bar Plot) يا ﻪﻗﺎﺳ رادﻮﻤﻧ (Stem Plot)

يا ﻪﻠﭘ رادﻮﻤﻧ (Step Plot) ﻲﺒﻄﻗ رادﻮﻤﻧ (Polar Plot) يا ﻪﻄﻘﻧ رادﻮﻤﻧ (Scatter Plot)

يا ﻪﻄﻘﻧ رادﻮﻤﻧ (Scatter Plot) ﻲﻄﺧ رادﻮﻤﻧ (Line Plot)

6/39

(8)

2-D Plot: Polar Plot

>> Step plot: use Laplacian Transform Polar Plot

7/39

(9)

2-D Plot: Polar Plot

Session4: Programming Dr. Afsaneh Mojra 8/39

(10)

2-D Plot: Polar Plot

0 1 2 3 4 5 6 7

0.5 1 1.5 2 2.5 3 3.5 4

9/39

(11)

2-D Plot: Polar Plot

Session4: Programming Dr. Afsaneh Mojra 10/39

(12)

2-D Plot: Polar Plot

1 2

3 4

30

210

60

240

90

270 120

300 150

330

180 0

data1

11/39

(13)

2-D Plot: Polar Plot

Session4: Programming Dr. Afsaneh Mojra 12/39

(14)

2-D Plot: Polar Plot

13/39

(15)

2-D Plot: Polar Plot

Session4: Programming Dr. Afsaneh Mojra

0.2 0.4

0.6 0.8

1

30

210

60

240

90

270 120

300 150

330

180 0

14/39

(16)

2-D Plot: Polar Plot

0.2 0.4

0.6 0.8

1

30

210

60

240

90

270 120

300 150

330

180 0

15/39

(17)

2-D Plot: Polar Plot

Session4: Programming Dr. Afsaneh Mojra 16/39

(18)

2-D Plot: Polar Plot

0.2 0.4

0.6 0.8

1

30

210

60

240

90

270 120

300 150

330

180 0

17/39

(19)

2-D Plot: Polar Plot

>>t = 0:.01:2*pi;

>>y=sin(2*t).*cos(2*t)

>>polar(t,y,'--r')

ﺎﻳ

>>t = 0:.01:2*pi;

>>polar(t,sin(2*t).*cos(2*t),'--r')

Session4: Programming Dr. Afsaneh Mojra 18/39

(20)

2-D Plot: Polar Plot

0.1 0.2

0.3 0.4

0.5

30

210

60

240

90

270 120

300 150

330

180 0

19/39

(21)

2-D Plot: Polar Plot

رﻮﺘﺳدﺪﻨﻧﺎﻣ polar

تﺎﺼﺘﺨﻣ أﺪﺒﻣ زا ﻪﻛ توﺎﻔﺗ ﻦﻳا ﺎﺑ ﺖﺳا

ﺖﺳا هﺪﺷ ﻢﻴﺳﺮﺗ رادﺮﺑ ﻚﻳ ﻪﻄﻘﻧ ﺮﻫ ﻪﺑ ﻲﺒﻄﻗ .

رﻮﺘﺳد فﻼﺧ ﺮﺑ Polar

ﺪﻨﻛ ﻲﻣ رﺎﻛ ﻦﻳﺰﺗرﺎﻛ تﺎﺼﺘﺨﻣ ﺎﺑ

ﻲﻟو ترﻮﺼﺑ

ﻚﻴﺗﺎﻤﺷ ﺪﻨﻛ ﻲﻣ ﻢﻴﺳﺮﺗ هﺮﻳاد ﻚﻳ رد

.

Session4: Programming Dr. Afsaneh Mojra

compass

20/39

(22)

2-D Plot: Polar Plot

1 . ﻪﻳواز رﻮﺤﻣ ﻒﻳﺮﻌﺗ (θ)

21/39

(23)

2-D Plot: Polar Plot

. 2 ﻲﻋﺎﻌﺷ رﻮﺤﻣ ﻒﻳﺮﻌﺗ (r)

Session4: Programming Dr. Afsaneh Mojra 22/39

(24)

2-D Plot: Polar Plot

. 3 ﻦﻳﺰﺗرﺎﻛ ﻪﺑ ﻲﺒﻄﻗ تﺎﺼﺘﺨﻣ ﻞﻳﺪﺒﺗ

pol2cart

23/39

(25)

2-D Plot: Polar Plot

. 4 رﻮﺘﺳد ياﺮﺟا compass

Session4: Programming Dr. Afsaneh Mojra 24/39

(26)

2-D Plot: Polar Plot

2 4

6 8

30

210

60

240

90

270 120

300 150

330

180 0

25/39

(27)

Cartesian & polar

ﻞﻳﺪﺒﺗ شور تﺎﺼﺘﺨﻣ

ﻲﺒﻄﻗ ﻦﻳﺰﺗرﺎﻛ ﻪﺑ

) يﺪﻌﺑ ﻪﺳ :(

Session4: Programming Dr. Afsaneh Mojra

Polar (θ, r, z)

Cartesian (x,y,z)

[x, y, z] = pol2cart(θ, r, z)

26/39

(28)

Cartesian & polar

ﻞﻳﺪﺒﺗ شور ﻦﻳﺰﺗرﺎﻛ ﻪﺑ ﻲﺒﻄﻗ تﺎﺼﺘﺨﻣ

) ود يﺪﻌﺑ :(

Polar (θ, r)

Cartesian (x,y)

[x, y] = pol2cart(θ, r)

27/39

(29)

Cartesian & polar

ﻪﺑ ﻦﻳﺰﺗرﺎﻛ تﺎﺼﺘﺨﻣ ﻞﻳﺪﺒﺗ شور ﻲﺒﻄﻗ

) ﻪﺳ يﺪﻌﺑ

:(

Session4: Programming Dr. Afsaneh Mojra

Cartesian (x,y,z)

Polar (θ, r, z)

[θ, r, z] = cart2pol(x, y, z)

28/39

(30)

Cartesian & polar

29/39

(31)

Cartesian & polar

ﻪﺑ ﻦﻳﺰﺗرﺎﻛ تﺎﺼﺘﺨﻣ ﻞﻳﺪﺒﺗ شور ﻲﺒﻄﻗ

) ود يﺪﻌﺑ :(

Session4: Programming Dr. Afsaneh Mojra

Cartesian (x,y)

Polar (θ, r)

[θ, r] = cart2pol(x, y)

30/39

(32)

Cartesian & polar

31/39

(33)

Cartesian & polar

atan2 & atan: Arctan Atan2(y,x)=Arctan(y/x)

Atan(y,x)=Arctan(y/x)

Session4: Programming Dr. Afsaneh Mojra

[-π,π] ﻲﺗﺎﺜﻠﺜﻣ هﺮﻳاد ﻞﻛ

[-π/2,π/2] ﻲﺗﺎﺜﻠﺜﻣ هﺮﻳاد ﻒﺼﻧ

32/39

(34)

2-D Plot: Scatter Plot

ﺎﻫ هداد ﺮﻳدﺎﻘﻣ ﻢﻴﺳﺮﺗ ترﻮﺼﺑ

ﻪﺘﺴﺴﮔ )

يا ﻪﻄﻘﻧ (

>>scatter(X,Y)

33/39

(35)

2-D Plot: Scatter Plot

Session4: Programming Dr. Afsaneh Mojra

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2

0 0.5 1 1.5 2 2.5 3 3.5 4

34/39

(36)

M-file: create

35/39

(37)

M-file: create

Session4: Programming Dr. Afsaneh Mojra 36/39

(38)

M-file

37/39

(39)

M-file: Save

Session4: Programming Dr. Afsaneh Mojra 38/39

(40)

M-file: Save

39/39

Referensi

Dokumen terkait