MATLAB: Help with Simple Directory Operations

directorytext file

Hello,
I have a simple question. I want to first check to see if a folder exists in the working directory. If not, then I create it. I got this part to work.
But now I want to add a second check outside the above check to see if the folder is empty. What is the easiest way todo the last check ?
Thank you!

Best Answer

sad = dir( folder );
any( not( [ sad.isdir ] ) )