Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedMATLAB 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 otherwise

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Databases The Essentials

Authors: Mary E. S. Loomis

1st Edition

020156341X, 978-0201563412

More Books

Students also viewed these Databases questions

Question

LO3 Name the seven categories of HR functions.

Answered: 1 week ago