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

Output element below the found element

解決済み
解決策を見る

I just started labview a couple weeks ago. I am trying to do a vi where I input a number and it would return me a different number which i have previously saved in an excel spreadsheet.

 

So, I used the Read from Spreadsheet function to read my saved spreadsheet and do an array. And I connected it to a Search 1D Array and connected the first row of my array to the Search 1D Array function. So, I know this would produce the index of the searched element. But, what I am actually looking to output is the element in the next cell.(same row, right column).  Do you guys know of any way that I could do it?

 

Thanks a lot in advance!

0 件の賞賛
メッセージ1/8
4,108件の閲覧回数

Hi yeshani,

 

when you found your index what's the problem in incrementing the index to pick the next element?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
メッセージ2/8
4,105件の閲覧回数

It would be easier if we could take a look at your code....

 

One simple way to do this would be to make two 1D arrays.  The first array contains the first column, that you search in.  The second array is the column you want to return the value from.

 

Search the first colum and find the index.  Then, wire that over to your second array to pull out the value you wanted using the Index Array function.

 

 

 

 

 

 

メッセージ3/8
4,104件の閲覧回数

Gerd,

 

That would give him the next element in the same 1D array.

 

He wants the corresponding element in the next array.

 

Instead of A[i+1], he wants B[i].

 

Or, we could say he locates A[i,j] and is looking for A[i,j+1], not A[i+1,j]

0 件の賞賛
メッセージ4/8
4,101件の閲覧回数

Yes, but is there a function that would return output an element, given its index?  Thanks guys!

0 件の賞賛
メッセージ5/8
4,085件の閲覧回数
解決策
トピック作成者ywijが受理

Yes, that's the "Index Array" function.

 

0 件の賞賛
メッセージ6/8
4,081件の閲覧回数

 

Yeshani wrote:

Yes, but is there a function that would return output an element, given its index?  Thanks guys!


 

It is Index Array Function

Function palette>>Array>>Index Array

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
メッセージ7/8
4,079件の閲覧回数

I do this thing all the time.  Use a Search 1D Array and Index Array.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 件の賞賛
メッセージ8/8
4,060件の閲覧回数