09-24-2015 03:32 AM - edited 09-24-2015 03:44 AM
Hello everyone!
I'm trying to implement a simple trick, thought couldn't find an appropriate simple solution. I have an initial array of bits. Then I periodically add fragments of 10x1 in it. The problem is to clear the array afterwards and get the source array. I'm trying to implement it in MathScriptNode.
Basically I need to delete all arrays B=[0 0 0 0 0 0 0 0 0 0] from array A.
In MathLab it is done with
C = A(setxor(cell2mat(arrayfun(@(x)(x:x+length(B)-1),strfind(A,B), 'UniformOutput', false)), 1:length(A)));
How to do it in MathNode in LabVIEW?
09-24-2015 03:38 AM
Hi beatle,
why do you want to use the "MathNode" (whatever this is)?
Why not use plain G?
And what do you want to show with this small image?
Keep your boolean array in a shift register. Search for 10 consecutive FALSE bits and delete them from the array, when found. Iterate until no FALSE blocks are found…
09-24-2015 03:56 AM
Hi!
Sorry for innacuracy, I corrected my post.I know how it should be in theory, I can't design a concrete implementation for it - a code in MathScript
09-24-2015 03:44 PM
If I undestand your question, I think all you want to do is maintain a copy of the origional data, and then switch that copy back in when you want to reset to the originoal data. You could do this a number or ways, some are better than others depending on your implementation. I am under the impression that you have an array of data you want to feed into a mathscript and have some result come out. In this case, all you need to do in this case is store the original data in a shift register,local variable, or a plain old wire and then replace the results with the origional when you want to reset.
09-25-2015 01:22 AM
Actually I'm trying to add redundant bits to the digital signal and then "decode" the resulting signal - get rid of these redundant bits. Block solutions seem complicated for this task, MathScript processing does it periodically - not in real time. I hoped there are some other options, which I as a rookie don't know yet.
09-25-2015 01:43 AM - edited 09-25-2015 01:43 AM
09-25-2015 01:53 AM
ok, I'm not asking for a ready solution - this forum doesn' work this way. If you need to implement a high-speed signal processing with coding-decoding of a signal you will use G functions? What functions then, from what pallete? Array functions? Ok, add fragment to array is easy, delete it - easy. But finding a sequence in the array in a random place, that matches your condition - pain in the ...
I mean this flow: adding a fragment to the source signal and send it - receive and find a fragment - delete the fragment and possibly further change the signal.
09-25-2015 02:35 AM - edited 09-25-2015 02:37 AM
Hi beatle,
implement a high-speed signal processing
What is "high speed" to you?
you will use G functions?
Yes.
What functions then, from what pallete? Array functions? Ok, add fragment to array is easy, delete it - easy.
You noticed my comment in this message?
But finding a sequence in the array in a random place, that matches your condition - pain in the ...
Why is it PITA to search for a boolean TRUE, then search for the next boolean FALSE and check the distance between both indices?
When the distance is greater than 9 you know you found a block of 10 TRUE bits…