Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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? 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started