Question: 1.a Write a matlab function that takes 2 numbers as input parameter taken from a user and returns the greatest one and the lowest one
1.a Write a matlab function that takes 2 numbers as input parameter taken from a user and returns the greatest one and the lowest one as output parameters.
Example: Write a number: 5
Write a number: 12
The greatest one is 12
The lowest one is 5
b Write a matlab function that takes a vector as input parameter and returns the greatest one and the lowest one as output parameters.
Example:
Vector = [5,1,3,4,9,44,12,34,-1]
The greatest one is 44
The lowest one is -1
c Combine a and c into one function by using nargin function.
d Write a matlab function that takes a vector as an input parameter and returns its median
value as output parameter.
Note: You think about length of vector with odd number and even number. You can use
Wikipedia about Median rules.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
