Depends what you mean by "same time." There is going to be a few milliseconds of latency. I would look at the MATLAB based port audio implementations. There are playrec and pa-wavplay (I am not sure i the latter handles input). My preference is for the audio part of the psychtoolboxhttp://docs.psychtoolbox.org/PsychPortAudio
I work at MathWorks and I have just noticed this so I thought I'd drop a note.
I understad from your question that you were looking to process the acquired audio live (aka in "real time", or "in the loop") using a standard sound card. In all such situations we recommend looking first at audioDeviceReader and audioDeviceWriter in Audio Toolbox, which were specifically designed with that use case in mind.