Hi all,
The below code is generating an error :
The code used here is:
%BATCH MODE
files = dir('C:\Users\Deakin Uni\Documents\MATLAB\a');fNames = {files.name};%for each file
for k= 1: length(fNames) % extract file name
fName = ['C:\Users\Deakin Uni\Documents\MATLAB\MAX', fNames{k}]; [XDATA, TIMESTEPS] = importfile(fName); a1 = XDATA - mean (XDATA); plot(TIMESTEPS, a1); [peakvals,peaklocs] = findpeaks(a1, 'minpeakdistance',50, 'minpeakheight', 0.00001); peaktime = TIMESTEPS(peaklocs); createfigure4(TIMESTEPS, a1, peaktime, peakvals) saveas(gcf, 'chaitu.fig') end
The error here is: Error using xlsread (line 132) XLSREAD unable to open file 'fName'. File 'fName' not found.
Error in importfile (line 36) data = xlsread(workbookFile, sheetName, sprintf('A%d:B%d',startRow(1),endRow(1)));
Thanks in advance
Best Answer