ITEC 2600 Study Guide - Quiz Guide: Binary Search Algorithm

95 views1 pages

Document Summary

Lab exercise 6: redo all examples from the lecture, generate vectors v1, v2, v3 and v4 that contain 100, 1000, 10000, 100000 random integers ranging between. 201to 599 separately, nd all indices of key value of 399 in v1, v2, v3 and v4 using sequential and binary search, and report the runtime in seconds. Write a function functions f nf nxy receives three input arguments: vector x and vector y, a function handle f nhan, output the results calculated from function handle passed. Write an anonymous function for r = px2 + y2, vectorizing your code. Write a script that call a function functions in a), given two vectors: v1 = [1 2 3 4 5] and v2 = [9 4 5 3 8], and anonymous function in b). You may try di erent equations with one or two or three variables: the wind chill factor (wcf) measures how cold it feels with a given air temperature (t, in degrees.