Matlab keep give me following error message :
??? Error using ==> dir Argument must contain a string.
Error in ==> Awal at 15 x = dir(subDirs)
Below is my codes :
%MY PROGRAM
clear all;
clc;
close all;
%-----Create Database-----
TrainDB = uigetdir('','Select Database Directory');
TrainFiles = dir(TrainDB);
dirIndex = [TrainFiles.isdir];
[s subDirNumber] = size(dirIndex);
for i = 3:subDirNumber
subDirs = {TrainFiles(i).name};
subDirs = strcat(TrainDB,'\',subDirs);
x = dir(subDirs) %<-------Error Here
end
Is something wrong with the codes? Your help will be appreciated. I'm sorry for my bad English.