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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!