function found = linearSearch(target, data) found = 0; for ii = 1:length(data) if data(ii)==target found = ii; return; end end