3582437328

3582437328



*4\ MATLAB 7.7.0 (R2008b)



File Edit View Insert Tools Debug Desktop Window Help


o a| *


O

4-»

c


'O P1 ife ź © Current Directory: H:\Documents\MATLAB

& i Editor - H:\Documents\MATLAB\bubbleSort.m o

14-

: O £3 ■

* % • >0

0

i s

. M M + fii.

-

? X

n|-

1.0

+

1.1

X

o/7% o/7% | Ot


? x Workspace


o

1

Dfunction A = bubbleSort (A)

2

3 - E

Dfor i=length(A)-1:-1:1

4 - E

3 for j = 2:i

5 - E

if A (j -1)>A (j)

6 OO

tmp = A(j-l);

7 -

A(j-l) = A (j);

8 -

A(j) = tmp;

5 -

end

10 -

end

11 -

end

12 -

- end

13

Command Window


’ Stack:

bubbleSort ^

Name ^

Value

Size

Bytes

Ba

<100x1 double>

100x1

Bi

99

1x1

Bj

2

1x1

4 III ►

Command History

Figures - Figurę 1

-»• n *

»

? X


.


Jd j k I \ % O 9 '-i A



ffl m b s


K» issorted (bubbleSort (rand (100,1))) ans =

0


K» issorted (bubbleSort (rand (100,1))) 6_ tmp = A (j -1);


K» plot (A, 1 - ro1 )

fii


Edit- 0


© Linked variables/expressions: A


4 Start


Stopped in debugger


_

I*


Wyszukiwarka

Podobne podstrony:
JednorekiBandytaLiczenieLosowańProg ^ File Edit View Insert Format Debug Run Tools Ądd-Ins Window He
JednorekiBandytaLiczenieLosowań icroso File Edit View Insert Format Debug Run Tools Ądd-Ins Window H
test 6 serrorm % File Edit View Insert Format Debug Run Tools Ądd-Ins Window Help o Project - Norm
PropertiesObrazka File Edit View Insert Format Debug Run Tools Ądd-Ins Window Help <o c-*► li Pro
Pętla IIb File Edit View Insert Format Debug Run Tools Ądd-Ins Window Help * *o O*► II f* *<§
reset File Edit View Insert Format Debug Run Tools Ądd-Ins Window Help -sl - U
Start % File Edit View Insert Format Debug Run Tools Ądd-Ins Window Help o► II ]§* W Ę* Ln 9, Col
StartStopJednorękiBandytaPorg File Edit View Insert Format Debug Run Tools Ądd-Ins Window Help 1*1
Jednoręki?ndyta asie - File Edit View Insert Format Debug Run Tools Ądd-Ins Window Help @ ii - y &

więcej podobnych podstron