So I have been having this issue for a while and I really would like to figure it out. I have a lot of data at 15 minute intervals and I want it over and hour. I have no issue doing this. The function that I call creates the correct OUTPUT. My issue is that I am not able to save the OUTPUT to a filename that takes the form ['data_1hr_2013',num2str(k)]. I need to figure out a way to save OUTPUT with the filename I create. Any help would be grealy appreciated. I could have sworn I used to do this all the time in previous versions of MATLAB. I am using 2014a now.
for k = 7:12 matFileName = sprintf('data_15min_2013%d.mat', k); if exist(matFileName, 'file') matData = load(matFileName); else fprintf('File %s does not exist.\n', matFileName); end OUTPUT = Conv15min2hr(eval(['matData.data_15min_2013',num2str(k)])); save(['data_1hr_2013',num2str(k)],OUTPUT);end
Best Answer