Following is the code used in matlab to sort a vector. n=length(A); for i=1:n for j=1:i if
Fantastic news! We've Found the answer you've been seeking!
Question:
Following is the code used in matlab to sort a vector.
n=length(A); for i=1:n for j=1:i if A(j) < A(i) Temp =A(i); A(i)=A(j); A(j)=Temp; end end enddisp(A)
I'm not sure how to create code such that any array can be sorted without the use of the sorting command. It is required to use the code above, which sorts a vector. This is also done in MATLAB. I appreciate any and all help.
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date: