Question: In MATLAB Sort 3 numbers (x1, x2, x3) using if conditions only. You cannot use sort() function. Use 3 input functions to ask for the
In MATLAB
Sort 3 numbers (x1, x2, x3) using if conditions only. You cannot use sort() function. Use 3 input functions to ask for the inputs.
Inputs: x1, x2, x3
Output: y=[x2 x3 x1] (where x2
Example: input1:5, input2:0, input3:-4
Output y = -4 0 5
Hint: Sort the 2 numbers first and assign it to a variable y12 with 2 elements.
Then compare the 3rd number with maximum and/or minimum of y12.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
