p=dir % Takes all the folders in the diractory
j=1 % flag variable
i= % iteration vaaiable
a=zeros(1,3) % value associated witht eh flag variable
a(1,j)=length(p)
for i=1:1:a(1,j)
if strcmp(( p(i).name),'.')==1
p(i)=[];
j=j+1
else
continue
end
a(1,j)=length(p);
end
Best Answer