The built-in function WAVRECORD requires the user to specify a duration of the data acquisition. This in impractical if we are waiting for short transient signals. In this case, we would like to monitor the input until such event occurs and then return a short vector containing the "sound event".
The function audiorec.m in this package makes use of the Data Acquisition Toolbox to solve the problem described above. The package also contains a small example script showing how to use it.