-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
psthRasterAndCounts gives psth that is undercounted in at the edge-bins #12
Comments
Good catch, yes looks like the first bin will be half as wide as the others (this is only going to be true for the last bin if the window size is evenly divisible by the bin size - I don't think it applies to the last bin in general). I think the correct fix is to change line 31 to start from |
So what I did was to replace line 31 with the following:
Matlab seems to highly recommend switching out the old calls to hist. |
Ok, looks good, could you make a pull request with that?
…On Wed, May 13, 2020 at 1:33 AM ilandau ***@***.***> wrote:
So what I did was to replace line 31 with the following:
edges = window(1):psthBinSize:window(2); [psth, edges] =
histcounts(stRelToEvent, edges); bins = edges(1:end-1) + psthBinSize/2;
Matlab seems to highly recommend switching out the old calls to *hist*.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#12 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABZ5IP4DGMB532THTMKEG53RRJLN5ANCNFSM4M6Y5MLA>
.
|
Sure. I'm a bit of a newbie to github collaboration. It looks like I need to be assigned as a "collaborator" in order to start a new branch and then make the pull request. Is that right? |
Hey there, I'm a new user. I noticed that the psth created by psthRasterAndCounts was undercounted in the first and last bin. Both psth and bins are returned as vectors that are the length of the number of edges, i.e. one more than the number of bins. This could be related to the old matlab hist function which used to accept bin-centers as inputs, whereas the new histogram function only accepts a vector of edges as inputs.
In any case, I made minor changes in the file locally to make it return psth and bins corresponding to the bin-centers and with length corresponding to the actual number of bins. I'd be happy to share that change. But maybe people out there are still using old versions of Matlab and that's why they're not running into issues?
The text was updated successfully, but these errors were encountered: