LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Indexing through every other column


@TheNameIsBailey wrote:

But if you already have it expanded, so in between all of your elements is a 0, would the approach still be the same? 


You would write some simple code to remove all empty rows and columns and thus reduced it to a problem that has already been solved 🙂 (Sorry, old mathematician joke ;))

 


@TheNameIsBailey wrote:

Reason being, it will help me visually see my thought process. 


I don't understand why you would need to visualize inefficient code. Wouldn't it be better to try to "visualize" some of our solutions? This way you probably learn more.

 

Still, I am sure it could be easily done...

 

Message 11 of 16
(799 Views)

Your "Array expansion" subVI, could also be replaced with code the size of a postage stamp. See if you can reproduce it

(For loop, interleave 1D arrays, built array, concatenating tunnel).

 

 

altenbach_0-1593827613143.png

 

Message 12 of 16
(796 Views)

I'd expect solutions that involve interpolation (Interpolate 1D Array or Interpolate 2D.vi) to be slower, as there's more work involved in arbitrary interpolation compared to simply adding the signals and divide by 2...

 

Some benchmarking would be required to know for sure...

Message 13 of 16
(745 Views)

So I've been messing around with every solution provided to see what fits best for me. I am currently trying to set it up with a for loop that runs through the process by N times (set by a control) however, I get a memory out of space error, (expected with the length of the array it is constantly creating), also do not see a change in image when I play with the control. Is that even possible to do or am I making things too complex as I typically do?

 

Current VI is using the Interpolate 2D way

 

loop by n times.png

 

0 Kudos
Message 14 of 16
(715 Views)

Edit: I tried a smaller image and it changes when I change n. It does however still get the memory error, even if I do not touch the vi while it is running.

0 Kudos
Message 15 of 16
(708 Views)

Nevermind I fixed the issue

0 Kudos
Message 16 of 16
(688 Views)