I need a code for sorting two column with a condition.
古いコメントを表示
Suppose I have two column X and Y. Each column has same number of values (lets say 10). The condition is that if {X(i)-X(i+1)>0 and Y(i)-Y(i+1)>0} OR {X(i)-X(i+1)<0 and Y(i)-Y(i+1)<0} count it as one pair and take i = 1 for now. Total pairs which I want to check for this condition are 10C2 = 45pairs (X1 with X2,Y1 with Y2 after that X1 with X3,Y1 with Y3 and this will go on and will make 45 pairs)
Please help me out with this Problem
Thanks,
3 件のコメント
Rik
2019 年 5 月 10 日
Will your vectors stay limited in length?
Akshay Kumar
2019 年 5 月 10 日
Jan
2019 年 5 月 10 日
What is the wanted output? You mention i=1, but what do you want to obtain finally? What have you tried so far and which problem do you have?
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Shifting and Sorting Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!