キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

bit complicated question

解決済み
解決策を見る

Hello,

 

so I have got coordinates, for example A(4,5); B(3,2); C(1,9), D(4,3). I need to order them into a rising order after the last numerical character so that they stay together. I mean: B(3,2), D(4,3), A(4,5), C(1,9).

Any idea?

Thank you for every answers.

0 件の賞賛
メッセージ1/7
3,325件の閲覧回数
Are you trying to sort your coordinates by the second field? Try using the Array 1D Sort function. This will sort an array of clusters by the first elements of the cluster. Therefore, if you store your data in clusters using the y axis coordinate as the first element, then your x axis coordinate as the second element and build an array of these, a sort operation will sort by the y-axis coordinate for you.
Thoric (CLA, CLED, CTD and LabVIEW Champion)


メッセージ2/7
3,319件の閲覧回数

Hello Thoric,

 

The idea is really good it would also work, but I have to give the letters to the coordinates, and with letters (as string) I can`t make sortable arrays. Do you have an idea how to add the letters to the coordinates and then to sort them together by one of the fields?

I hope i don`t disturb you so much,

 

Thomas

0 件の賞賛
メッセージ3/7
3,291件の閲覧回数

Thomas,

 

Make a cluster of three elements: [ y, x, Letter], where y and x are the numeric coordinates and Letter is a string control with the names of the points.  Put these clusters into an array and use the array sort.  By putting y first in the cluster as Thoric said, you get the sort on that component.

 

Lynn 

メッセージ4/7
3,282件の閲覧回数
解決策
受理者 raditomi

johnsold wrote:

Thomas,

 

Make a cluster of three elements: [ y, x, Letter], where y and x are the numeric coordinates and Letter is a string control with the names of the points.  Put these clusters into an array and use the array sort.  By putting y first in the cluster as Thoric said, you get the sort on that component.

 

Lynn 


 

.... and in the event of two Y values being the same, the tie-breaker is the second element in the cluster (X).

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
メッセージ5/7
3,279件の閲覧回数

Thanks, Ben.  I forgot about that when I answered, although the issue of multiplicity did occur to me when I first read the question.

 

Lynn 

メッセージ6/7
3,276件の閲覧回数

It works 🙂

I just wanted to thank you guys for helping me.

 

Have a nice day,

Thomas

0 件の賞賛
メッセージ7/7
3,257件の閲覧回数