06-24-2021 06:47 AM
Hi,
I am trying to develope a code using string array as the input.I need like it should compare 1st row and 2nd row in an string array ,if it is true then it should move on to 3rd row and then 3rd row should compare with 4th row.If it is false,then 2nd row should deleted and then it should move on to 3rd row and then 3rd row should compare with 4th row.It continues till the string array is get completed. In my code ,how to improve it?
ex:
1100
1100
0100
0110
1011
1011
output:
1100
1100
0100
1011
1011
06-24-2021 06:58 AM - edited 06-24-2021 07:09 AM
Hi puppy,
puppy@11111 wrote:
In my code ,how to improve it?
There's no code, there's just a small downscaled blurry image…
When you want to compare more than just 2 rows from your 2D array then you should use a loop somewhere in your code!
As you didn't provide (real) code I also provide a solution just as an image:
06-24-2021 08:07 AM
Hi Gerdw,
Thanks for your reply.I have shared my code here.I n my code in 1st iteration 0th index and 1st index is get compared and in 2nd iteration 1stindex and 2nd index is get compared but what I need is like 2nd and 3rd is should get compared so what changes I have to do in my code.
06-24-2021 09:03 AM
Hi puppy,
puppy@11111 wrote:
I have shared my code here.
No, there is no code.
Again just an image of code: we cannot debug/edit/run images with LabVIEW!
puppy@11111 wrote:
I n my code in 1st iteration 0th index and 1st index is get compared and in 2nd iteration 1stindex and 2nd index is get compared but what I need is like 2nd and 3rd is should get compared so what changes I have to do in my code.
Well, a simple change would be to recreate MY code instead of YOURS…
(Your code does not what is required to do: so it is wrong!)
06-24-2021 10:13 AM
puppy@11111 wrote:
Hi,
I am trying to develope a code using string array as the input.I need like it should compare 1st row and 2nd row in an string array ,if it is true then it should move on to 3rd row and then 3rd row should compare with 4th row.If it is false,then 2nd row should deleted and then it should move on to 3rd row and then 3rd row should compare with 4th row.It continues till the string array is get completed. In my code ,how to improve it?
ex:
1100
1100
0100
0110
1011
1011
output:
1100
1100
0100
1011
1011
As has been asked already, please attach your VI, preferably with typical default data in all controls.
First we need correct instructions:
06-24-2021 10:29 AM
@altenbach wrote:
If these are typical values, you could convert each row two a 4bit integer and operate on 1D numeric arrays. Much more efficient.
Here's how that could look like (assuming all strings are single character and either 0 or 1):