Question: MATLAB Problem 03 Write a function file named myset.m that has one input parameter, vector v, and returns a vector that contains only the set
MATLAB

Problem 03 Write a function file named myset.m that has one input parameter, vector v, and returns a vector that contains only the set of values in v (a set has no duplicate values), or returns the empty vector, if v is an empty vector. For example, given v- 1 246626 1,the vector returned should be the values [ 1 2 4 6 1, and given v - [], the vector returned should be []. Your code should use one or more for loop(s) and conditional statements (if, else, etc.). Do not use the MATLAB built-in function named unique. Your code should work with any given vector of arbitrary length, and not just the example values. NOTE You do not need to write a help comment (H-lines) for this function. Then, write a script file named mysettest.m that displays the values returned for the text vector v such that v 1 2 46626]. Hint Break the given problem into smaller problems, and think carefully about how to compose the smaller problems back together to form a solution to the original problem provided. First of all, how could we check, without using any built-in functions, if a given scalar value occurs in a row vector? Then, how could we perform the same check for an array of scalar values? One possible solution to this problem utilizes a nested loop structure. Another possible solution utilizes the "shorthand notations" composed of relational operators, as well as the built-in MATLAB function sum. This only uses one loop. Use of sum is permitted for this particular case. Example Output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
