Question: The following function will take three inputs: data, and category, two arrays with numerical data and category labels for data, and selectcat, a category of
The following function will take three inputs: data, and category, two arrays with numerical data and category labels for data, and selectcat, a category of data to return. It returns sift, the data from the selected category.
Which of the following statements about the function below is TRUE?
function sift sifterdatacategory, selectCat
length data
sift zeros
count
for :
if category i selectCat
sifti datai;
count count
end
end
sift sift : count;
sift should be indexed with count instead of
The line of code for : should read for count :
The variable count is unnecessary.
data should be indexed with count instead of
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
