Why i get this following error when using dir in Matlab?
        Posted  
        
            by nata
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by nata
        
        
        
        Published on 2010-05-25T14:18:25Z
        Indexed on 
            2010/05/25
            14:31 UTC
        
        
        Read the original article
        Hit count: 193
        
matlab
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.
© Stack Overflow or respective owner