Question: Which of the following statement on the function below is true? Recall that sifter function picks out only data from the selected category. function [sift]

 Which of the following statement on the function below is true?

Which of the following statement on the function below is true? Recall that "sifter" function picks out only data from the selected category. function [sift] = sifter(data,category,selectCat) L= length(data); sift =zeros(1,1); count =1; for i=1:L if category (i) == selectCat sift(count) =data(i); count = count +1 ; end end sift =sift(1 : count); In the last line of code, "count" should be subtracted by 1 to get correct result In the last line of code, "count" shall be replaced by "L" to get correct result Before the loop, "count" should be initialized as 0 instead of 1 to get correct result Inside "if" statement, the 2 lines of code shall be swapped to get correct result

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!