MATLAB: I want to read image name to be an string

namestrings

I = imread ("28-30-50-30.jpg");
after I ran this function I will get the image in variable "I",
but I want to read name of this picture ("28-30-50-30.jpg") in string to do the next step in strsprit().
How can I do it??

Best Answer

imgNames = dir('*.jpg') ;
N = length(imgNames) ;
for i = 1:N
img = imgNames(i).name
end
Related Question