This preview shows page 1. Sign up to view the full content.
Unformatted text preview: %the true positions in order to index to the new array later and only %return those positions in the original array of elements that were true in %those respective positions yes = arr_indexes>0 & mod(arr_indexes,1)==0 & arr_indexes<=length(arr_elements); %the variable yes returns a true only if the respective elements are %greater than zero and the elements are positive integers and if the length %of the array of indexes is less than or equal to the length of the %elemen error_flag = ~all(yes); arr_indexes(~yes) = ; arr1 = arr_elements(arr_indexes); a end...
View Full Document
- Spring '08