Hey there! I'm a clueless beginner when it comes to Matlab. So if you would be so kind and answer my questions as simple as possible. I have many problems with what I want to do in Matlab:
- Item one Import csv-files in a loop. My idea:
for k=1:NDatei if ~exist(sprintf('20140512-0013_%03d.csv',k), 'file') errordlg(['File ' num2str(k) ' does not exit'],'File Error'); break ; end data=importdata(sprintf('20140512-0013_%03d.csv',k)) ; end
Whereas my data has names like '20140512-0013_001.csv', '20140512-0013_002.csv',.. Problem is that Matlab tells me that my files don't exist. I think it's a problem with the path. Do you know why Matlab doesn't find the files although they are in a subfolder of the Matlab folder?
- Item two Findpeaks: I want to count the Peaks in each file with a certain threshold and minimal peak distance. Apparently Matlab has some problems with my imported files, because I get the Error
Error using findpeaksExpected X to be one of these types:double, single, uint8, uint16, uint32, uint64, int8, int16, int32, int64Instead its type was char.Error in findpeaks>parse_inputs (line 90)validateattributes(Xin,{'numeric'},{'nonempty','real','vector'},...Error in findpeaks (line 71)[X,Ph,Pd,Th,Np,Str,infIdx] = parse_inputs(Xin,varargin{:});
Thank you so much for your help. I will attach the files as an example. I'm really looking forward to your answers and thoughts. Cheerio! Tanja
Best Answer