paperclippy: (huh?)
[personal profile] paperclippy
I think there is a stupid obvious answer to this question, but I am at a total loss.

I have an array of length N. I want to divide it into D bins. N/D is not an integer. How do I do it without just taking the floor of N/D and then having a huge bin at the end?

Is the following a valid option? Let T = floor(N/D). First bin is length T. Then let T = floor((N-T)/(D-1)), etc? Does that work?

I really think this is something stupid that I used to know how to do but I have forgotton. If any of you know a matlab function that does exactly what I want, even better (I ultimately want a new array, length D, which has the average of each of those bins as its values).
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

paperclippy: (Default)
paperclippy

April 2017

S M T W T F S
      1
2345678
9101112131415
161718 19202122
23242526272829
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 15th, 2025 07:19 pm
Powered by Dreamwidth Studios