I am retrieving file names of Images in a array as:
image_files = dir(strcat(dir_path, '\*' , img_extension));
s = image_files(j).name
Now I need to save names of images files in a file, but first I need to concatenate all the image names in a single matrix,
M = [M, s]
However since s is a character array, all the characters of file names will be treated as separate columns where as I need to treat a single file name as a single entity in M.
Is there any work around?
{image_files.name}. It produces a cell array, if you are okay with it.dlmwritedoesn't support strings, only numeric data (the fact that it apparently happens to work withchararrays is an undocumented feature) - you'd be far better off using a cell array of strings.