TWOEARS / auditory-front-end

Two!Ears Auditory Model - Auditory front-end module
http://docs.twoears.eu/en/latest/afe/
GNU General Public License v2.0
16 stars 10 forks source link

accomodate size() dimension arg #23

Closed kashefy closed 7 years ago

kashefy commented 7 years ago

circVBufArrayInterface has its own implementation of size() but without the optional dim argument. This enables an optional second dim argument. Possible solution for #22

hagenw commented 7 years ago

Hi. @Hardcorehobel will not be available to review this, so I will have a look on this later.

chris-hld commented 7 years ago

Works, but if the dim argument exceeds the defined dimensions, it just returns 1. Is that a problem?

Try in DEMO_Autocorrelation.m:

size(dObj.autocorrelation{1}.Data)

ans =

   124    16   319
size(dObj.autocorrelation{1}.Data,2)

ans =

    16
size(dObj.autocorrelation{1}.Data,6)

ans =

     1
kashefy commented 7 years ago

This is the same behavior as the usual size().

size(magic(3), 1)

ans =

 3

size(magic(3), 3)

ans =

 1

But no idea if this is something we want to deliberately avoid. I think it's ok. What do you think?

hagenw commented 7 years ago

No, that is ok, and also not an error as 1 is not wrong.

I'm going to merge this now.