Sometimes when I am using the Audio System Toolbox, I need to add a device midway through a session of MATLAB, but when I add the new device I can't get MATLAB to recognize it even though my computer says that it is connected. So far, the only way I have been able to get the new device recognized is to restart MATLAB, which is not ideal. See the following code for an example:
>> deviceReader = audioDeviceReader; >> devices = getAudioDevices(deviceReader); % shows 4 devices
>> % Connect new device
>> clear>> deviceReader = audioDeviceReader;>> devices = getAudioDevices(deviceReader); % still shows 4 even though 5 are connected
Is there a way that I can get MATLAB to recognize new devices without having to restart?
Best Answer