Check out example codes for "if directory exist matlab". It will help you in understanding the concepts better.

Code Example 1

if ~exist(yourFolder, 'dir')        mkdir(yourFolder)     end

Learn ReactJs, React Native from akashmittal.com