Answered step by step
Verified Expert Solution
Question
1 Approved Answer
MATLAB QUESTION. PLEASE ANSWER THIS USING MATLAB 2. [10 marks] In this question you must write a MATLAB function that finds duplicated elements in a
MATLAB QUESTION. PLEASE ANSWER THIS USING MATLAB
2. [10 marks] In this question you must write a MATLAB function that finds duplicated elements in a vector. The output of the function must result in a new vector containing only unique instances of the duplicated values For example, the duplicated element vector E of the vector x- [2 3 2 4 5 652 1 1] is E [2 5 1] Note that the duplicated element vector does not need to be sorted in any particular order, however it must contain only one of every duplicated value of the input vector. Write a MATLAB function find_duplicates (x) that computes and returns the duplicated elements vector of the vector x. You must make sure that the vector x contains only numbers and if not return an appropriate error message. NOTE : You may NOT use the MATLAB functions unique or find in your answer. Hints The MATLAB function isnumeric(A) returns 1 if A is a numeric array and 0 otherwise. The MATLAB function ismember (A,B) where A is a number and B is a vector, returns 1 isutaiud in Band O otherwiseStep 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