I have two .mat files that are linked with each other. The first file named event_list is 61×1 and has the names of event categories in photographs. For example event_list(1)=parade, event_list(2)=outdoor, etc
The second file is called file_list and is again 61×1 cell array. Each element of file_list is a cell array. For example file_list(1) is a 575×1 array with all the names of the photographs in the folder parade (event_list(1)).
I am trying to create a txt file from these .mat files that will list the folder name (eg parade, outdoor, etc) and then the photograph name in that folder.
For example, I need it to be like this:
paradephoto1_paradeparadephoto_2_paradeoutdoorphoto1_outdooroutdoorphoto2_outdoor
This is the code I have written so far:
fid=fopen('MyFile.txt','w');%
for i=1:size(event_list) fprintf( event_list{i,:}) fprintf(fid, [ event_list{i,:}, '\r\n']); element=file_list{i,1} fprintf(fid, [element, '\r\n']);end
I am getting the following error:
Error using horzcat Dimensions of matrices being concatenated are not consistent.
Error in Untitled (line 11) fprintf(fid, [element, '\r\n']);
Thank you!
Best Answer