Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2) The function below tries to find and answer to, What is the list of the numbers that repeat 3 times in a given array?
2) The function below tries to find and answer to, What is the list of the numbers that repeat 3 times in a given array?" ( e.g: array=[ 1 2 3 4 5 2 3 531162 7] is given to the function and it has 3 values which repeat 3 times (2,3 and 4) so the function will return [23"), if there is/are... please correct the error(s) in the given function below 1. function res=find_three_times (array) 2. for i=1:length (array) 3. found=0; 4. for j=1:length (array) 5. if array(j) ==array(i) 6. found=found+1; 7. end 8. end 9. end 10. for i=1:length(found) 11. if found (i)==2 12. res (cnt)=array(i); 13. cnt=cnt+1:1 14. end 15. end 16. eleminate_the_redundant (res); $the given function in Q1 is assumed to be corrected
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