Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1) The program below uses the given functions to eliminate all the redundant numbers stored in the array which is taken from the user, (the
1) The program below uses the given functions to eliminate all the redundant numbers stored in the array which is taken from the user, (the user continuously enters integer numbers and finally enters -1 to end entering numbers but the lastly entered -1 will not be included in the array) please correct the error(s) if there is/are... myprogram.m 2. 3. S. 6. 7. 8. the array'); clear clc x=-1; array(); while X-1 clc; disp('Enter -1 to end entering new values to x=input(':'); while X-=-1 array(cnt)=x; cntcnt+1; end end array -eleminate_the_redundant (array) 10. 11. 12. 13. 14. myfunction.m 1. 2. 3. 5. 7. function array-eleminate_the_redundant (array) for i=1: length(array) for j=1:1 if array(i)==array ( ) array(i)=-1; break; end end end for i=1:length(array) if array(i)=-1 array2 (k)=array(i); k=k+1; end end 9. 10. 11. 12 13. 14. 15
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