hello, how could I take part from string for ex. I have this path : C:\Users\khs\Desktop\pics\photos and want matlab to make it C:\Users\khs\Desktop\pics\ futhermore want it to take the name of folder ( khs ) please help me thanks
Zynk - try usingpwd withstrfind to determine the index of the last occurrence of the slash /. Then just remove it and everything that follows. Something like
mydir = pwd;
idcs = strfind(mydir,'/');
newdir = mydir(1:idcs(end)-1);
Try the above (or a variation of it) and see what happens!
Best Answer