LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting only the odd rows of an array

Solved!
Go to solution

Yes, it depend if we do 1 based or 0 based counting. 😄

(no way to tell from the original question)

0 Kudos
Message 11 of 17
(1,513 Views)

Just for kicks, here are a few other ways to do it. Probably less efficient. 😉

 

 

Message 12 of 17
(1,506 Views)

Actually even or odd doesn't matter for me, i just wanted 1 row every 2.
I'm using some image processing algorithm and it will work even with half the rows so ^^

Thanks a lot everyone

0 Kudos
Message 13 of 17
(1,488 Views)

My first thought upon seeing the question was, "Why not use decimate?" then I realized that the decimate function was 1D only....still, never let such a little thing get in the way of Science!  Or more accurately, never let it get in the way of some fun and giggles.....

 

Decimate Fun.png

 

Not going to claim this is in anyway efficient, but was kind of fun to write.

Jon D
Certified LabVIEW Developer.
0 Kudos
Message 14 of 17
(1,474 Views)

@Mythilt wrote:

My first thought upon seeing the question was, "Why not use decimate?"


 

If we want to keep the rows with even index (as in my other code), here's all we need. (And only small tweaks are needed to get the odd indices or deal with inputs containing an odd number of columns. Nothing a reshape before the decimate operation or picking the other output could't fix).

 

 

For some reason, I think you have way too much code. 😄

 

Actually this was my first idea yesterday, but I did not add it because both transpose seem to have allocation dots.

0 Kudos
Message 15 of 17
(1,467 Views)

@altenbach wrote:

For some reason, I think you have way too much code. 😄


Smiley Very Happy

Part of it was I had an initial idea, and dangnabbit, I was going to code it.  The other part is because I didn't think of that. Smiley Tongue

Jon D
Certified LabVIEW Developer.
0 Kudos
Message 16 of 17
(1,454 Views)

@Mythilt wrote:

...s I had an initial idea, and dangnabbit, I was going to code it.  

I know that feeling 😄

0 Kudos
Message 17 of 17
(1,451 Views)