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

Sorting array

解決済み
解決策を見る

I know how to sort the array of strings alpha numerically but my problem is that the numerical values will not follow there corresponding strings

 

here is the code i am using:

 

 

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 件の賞賛
メッセージ1/6
4,803件の閲覧回数
Attach ur input files.
Balaji PK (CLA)
Ever tried. Ever failed. No matter. Try again. Fail again. Fail better

Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
0 件の賞賛
メッセージ2/6
4,801件の閲覧回数
解決策
トピック作成者Harold_Timmisが受理

Well, assuming that the two arrays are of equal size, you would bundle in a FOR loop, sort, the unbundle in a second FOR loop, e.g. as follows:

 

 

This takes advantage of the fact that arrays of clusters are sorted according to cluster order.

Message Edited by altenbach on 04-02-2009 10:31 PM
メッセージ3/6
4,791件の閲覧回数

It worked perfectly, I did try this except I tried it with a case statement not a good idea lol

 

thanks

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 件の賞賛
メッセージ4/6
4,775件の閲覧回数

Hi.

 

It's nice to have "sorting array" icon.

But I have problem with programming similar option. I want to sort my sine samples taken in more periods to just one period.

Beside defining that mycurrent sample should be less than next one, and greater from previous one in one case, I should take in consider that derivation could be positive or negative. While negative derivation, next sample should be less then current and so one.

Can someone help me with programming?

 

I've extracted the first period, and then I have to go trough each sample and compare him. When logic is well,I get the index and putinsert elemt in array.

 

I think that I'm having problem with while loops. I don't know where to put them.

 

I'm attaching VI. beacuse I'm working on Labview 9.0, I'm attaching also a pic.

 

Thanks in advance.

すべてをダウンロード
0 件の賞賛
メッセージ5/6
4,444件の閲覧回数

Tina

 

I don't quite see what your problem has to do with sorting, so please start a new thread instead of adding to an old thread that is already marked as solved.

 

(You seem to have some basic misunderstanding of local variables. A local variable just points to a control or indicator, so writing to an indicator and to a local variable of the same indicator makes no sense. You also introduce a race condition, because there is no quarantee that the reading of the index local occurs after writing to the terminal. If it occurs first (very likely!), your results will be wrong. Eliminate the locals and just branch the blue wire!)

Also your sequence frames have no purpose. Execution order is fully determined by dataflow just fine. Why clutter the diagram?
Message Edited by altenbach on 01-20-2010 11:14 AM
0 件の賞賛
メッセージ6/6
4,430件の閲覧回数