MATLAB: How to do this one..?

ascendingdescrndingMATLABsorting

Suppose I have three numbers 6 3 and 9
I want to assign
x1=lowest number
x3=highest number
x2= remaining number
How to do this??

Best Answer

  • Put the numbers into a vector, sort the vector, then make assignments to your variables from this sorted vector.