03-08-2017 03:24 PM
Yes, it depend if we do 1 based or 0 based counting. 😄
(no way to tell from the original question)
03-08-2017 03:42 PM - edited 03-08-2017 03:43 PM
03-09-2017 02:36 AM
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
03-09-2017 08:50 AM
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.....
Not going to claim this is in anyway efficient, but was kind of fun to write.
03-09-2017 09:54 AM - edited 03-09-2017 09:57 AM
@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.
03-09-2017 10:37 AM
@altenbach wrote:
For some reason, I think you have way too much code. 😄
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.
03-09-2017 10:47 AM
@Mythilt wrote:
...s I had an initial idea, and dangnabbit, I was going to code it.
I know that feeling 😄