function ans = CDsearch(coll, value) %% ans = CDsearch(v, value) index = 1; notfound = true; ans = []; while notfound && (index <= length(coll)) aCD = coll(index); if strcmp(aCD.artist, value) ans = aCD; notfound = false; end index = index + 1; end