MATLAB: How to use “dir” with multiple search strings? or join the results of two dir calls

dir

Hi,
How can I use "dir" with multiple search strings? or join the results of two dir calls?
I basically want to do something like this:
dir('*.txt','*.doc')
so that I get a list of the .txt and .doc files.
Or join the results of two dir calls.

Best Answer

jointdir = [dir('*.txt'); dir('*.doc')];