ALA C, 2003-04, Matlab exercise 2

 

[Kurssidan, vecka 1, vecka 2, vecka 3, vecka 4, vecka 5, vecka 6, vecka 7, Matlab]

if ... end

Write a program for finding the minimum m of N numbers f(1), ... , f(N) according to the sorting algorithm described on page 873 of AMBS. Use the template minimum.m.

Hint:

if f(i) < m

...

end

Debugging: choose a simple test example with only a few numbers, for example N=4. Remove all semicolons in the program and run it. Do exactly the same calculations by hand with pencil and paper and compare with what the computer does. Do this until you understand everything.


Editor: Stig Larsson
Last modified: Sun Jan 18 21:18:16 MET 2004