LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

subtracting and comparing array elements

Solved!
Go to solution

Hi,

I am trying to subtract first element with other elements of array to check whether the results is more than abs.5 or not. Then i want to get this ROW number of that element.

Ex: array is 1,1,2,3,4,4,5,6,7. i will check 1-1 > 5? else 1-2 > 5 else 1-3> 5 until.... 1-6 > 5.

now i want to save/get this ROW number of 6 i.e 8 to use it somewhere. and stop this subtraction process.

 

How can i?

0 Kudos
Message 1 of 13
(7,463 Views)

Hi Blokk,

 

Thanks for your reply. I did gone through some basics and even tried few solutions.

But am struck at finding the ROW when the case is true and get out of the loop/exit/stop.

 

Any help is appreciated.

0 Kudos
Message 3 of 13
(7,441 Views)

your requirement states "|1-6|>5 == success", but that means you might want a greater-equal comparison.

find-index.png

 

btw .. you should talk about index/element-at, a row makes sense only in a multi dim array


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
Message 4 of 13
(7,435 Views)

You get help more likely if you attach your VI with comments. Show us what you find difficult, or what is not clear. Try to break the home work into smaller parts, and first solve/understand these, before putting everything together.

Do not expect that someone gives you here a complete solution. But if you give a good question, you can get a good answer 😉

Some hints: do you understand how While and For loops work? Do you understand Shift Registers? Did you get familiar with the Array functions? Do you understand Data Flow in LabVIEW?

If your answer is NO for some of these questions, then you should learn a bit more the basics...

0 Kudos
Message 5 of 13
(7,433 Views)

sorry .. i like doing homework sometimes 😉

 


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 6 of 13
(7,430 Views)

@jwscs wrote:

your requirement states "|1-6|>5 == success", but that means you might want a greater-equal comparison.

find-index.png


sjscs: Please do not solve home works, this forum is not for that.

0 Kudos
Message 7 of 13
(7,429 Views)
Solution
Accepted by topic author sacsk123

ai.png

"If you weren't supposed to push it, it wouldn't be a button."
Message 8 of 13
(7,378 Views)

Thanks Paul.

yes this what i was looking for. Search and find the array index when it is True worked for me.

i was struck at how to handle the array of T,F booleans.

 

0 Kudos
Message 9 of 13
(7,348 Views)

This is mainly a performance questions. I have a master list of all users existing in a String array AllUids. I also have a list of all end dated users existing in a String array EndUids.

0 Kudos
Message 10 of 13
(7,343 Views)