LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Compare two string

Solved!
Go to solution

Hi 😄 I have to compare two nucleotide  sequence  in different  size. On output I have to receive index (of longer sequence) in which nucleotide are the same.

 

I need help and tips. On the beginning I was thinking that function Match Pattern will be enough but now I see that I have huge problem with this task. 

0 Kudos
Message 1 of 5
(2,331 Views)

Hi Girl,

 

so you want to search for one string inside another string? Use MatchPattern…

 


@Crazygirl wrote:

I need help and tips. On the beginning I was thinking that function Match Pattern will be enough but now I see that I have huge problem with this task. 


Which problems do you encounter?

What is your current state of the VI?

Can you attach your VI with example strings and expected output?

 

Btw. putting your email address in public forums is begging for SPAM…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(2,318 Views)

Seems you are looking for the Longest Common Subsequence.

 

Good news is, it's been done before.

Bad new is it isn't trivial.

 

I suppose it depends on the lengths of the sequences, for small strings you'd need less efficiency, and a naïve algorithm might work...

0 Kudos
Message 3 of 5
(2,303 Views)

Hi everyone 🙂

 

I have to compare two nucleotide  sequence  in different  size. On output I have to receive index (of longer sequence) in which nucleotide are the same.

I made it but this work only when this sequences are the same 😞

I would appreciate if someone help me. 

0 Kudos
Message 4 of 5
(1,893 Views)
Solution
Accepted by topic author Crazygirl

Hi girl,

 

no need to start a new thread for the very same problem…

 

You forgot to include typical inputs in your "sequence" strings. Please provide typical inputs and the expected output for those inputs!

What purpose has that while loop?

Why is there an "default if unwired" tunnel in the case structure?

Why is the shift register not initialized?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 5
(1,858 Views)