If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
comparing arrays
2 posts
• Page 1 of 1
comparing arrays
I need some simple code for comparing arrays and getting output with 0/1 values.
example input1:
50
50
50
...
example input2
40
50
120
...
output array: 1 if input1>=input2, else 0
0
1
1
...
Note: basically I will need to extend it into value versus range (to check whether value is within a range specified by two arrays: min and max) and range versus range (to check whether there is a common part between range1 made of min1 and max1 array and range 2 made of min2 and max2 array). Anyone has it perhaps...?
example input1:
50
50
50
...
example input2
40
50
120
...
output array: 1 if input1>=input2, else 0
0
1
1
...
Note: basically I will need to extend it into value versus range (to check whether value is within a range specified by two arrays: min and max) and range versus range (to check whether there is a common part between range1 made of min1 and max1 array and range 2 made of min2 and max2 array). Anyone has it perhaps...?
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
Re: comparing arrays
Okay, the problem I had was with automatic output conversion. Ruby does not donverts booleans to integers, like greenery does.
So here are 3 goodies.
1) simple compare between two arrays (between row elements on two arrays)
2) check if value is within range (detection for array set of course)
3) check if 2 ranges have some common part
So here are 3 goodies.
1) simple compare between two arrays (between row elements on two arrays)
2) check if value is within range (detection for array set of course)
3) check if 2 ranges have some common part
- Attachments
-
- compare arrays.fsm
- (839 Bytes) Downloaded 831 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 69 guests