This preview shows page 1. Sign up to view the full content.
Unformatted text preview: %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 %array of elements error_flag = ~all(yes); %if yes is true, then the ~ of all of the yes will return a true only if %all of the yes was true; otherwise the error will be false if the any part %of the yes is false arr_indexes(~yes) = ; %this removes the indexes where the false values were positioned to leave %the array of indexes with only the true positions and their respective %values arr1 = arr_elements(arr_indexes); %the new array of indexes that we updated will be used to index those true %elements in the array of elements that were true; this will return the %answer in the new array % end...
View Full Document
This note was uploaded on 10/21/2010 for the course CS 1371 taught by Professor Stallworth during the Spring '08 term at Georgia Institute of Technology.
- Spring '08