qualityAssurance - cell={}; y = cell2{x}; z = class(y);...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function cell = qualityAssurance(cell2) %function to compare these elements to specified criteria and removes %elements that do not meet the requirements listed below; the function will %return a cell array containing only those elements that do meet the %specified criteria: % % - If the element contains logical values, the logical values must all % be true. Any cells containing logical vectors with a false should % be removed. % - If the element is a string, the string must contain a space. Any % cell containing a string without a space should be removed. % - If the element contains a double, it must have a length smaller % than five and have a sum of at least 100. Otherwise, remove that % cell. %usage: cell = qualityAssurance(cell2) for x = 1:length(cell2) %takes the first element of cell2 and takes it through the for loop. .. %then repeats the process for the following elements
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: cell={}; y = cell2{x}; z = class(y); switch z case 'logical' if all(y) cell = [cell {y}]; end %this case statement determines if the element extracted is of data %type logical; if it is, then it finds and removes the false values %from the cell case 'char' if strcmp(y,' ') cell = [cell {y}]; %this case statement determines if the element extracted is of data %type char; if it is, then it finds and removes all the spaces from %the cell case 'double' if length(y)>5 & sum(y)<100 cell2(x)=; cell=[cell {y}]; %this elseif and if statement determine if the element %extracted is of data type double; if it is, then it checks to %make sure its length is less than five and its sum is greater %than one hundred; if it does not satisfy both conditions, the %entire cell is removed else cell=[cell {y}]; end end end 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.

Ask a homework question - tutors are online