I need help in finding the right sequence of rows
Show older comments
I have the column array of
A = [2 3 2 5 6 1]'; % This is a column as I have transposed the row
Now I need the code or any hint which gives me the index of rows having the increasing order i-e from the array the row with lowest number is 6 and then 1 as "1" comes before "3" as we have a tie between rows 1 and 3 but as 1 comes before 3 so we take the row 1 as next so, like this we have the following order of row desired
6,1,3,2,4,5
As 6th row contains the smallest element and next comes 1st row and then comes the 3 rd row and then comes 2nd row followed by 4th row which contains 5 and then lastly the 5th row which contains the largest element
I have tried a lot but couldnt come up with the logic
Accepted Answer
More Answers (0)
Categories
Find more on Shifting and Sorting Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!