I've got two runs of rest data collected on a subject. Running through RetroTS on the first run worked fine, but I get the following error when trying run2:
File ./subject_epi_run2.Resp.1D exists and will be read.
Reading file
Error using griddedInterpolant
The grid vectors are not strictly monotonic increasing.
Error in interp1 (line 191)
F = griddedInterpolant(X,V,method);
Error in PeakFinder (line 267)
R(icol).ntraceR = interp1( R(icol).tntrace', R(icol).ntrace, ...
Error in RetroTS (line 281)
[R,e]= PeakFinder(Opt.Respfile,OptR);
The problem seems to be the with run2.Resp.1D file, but I cannot figure out the problem. RetroTS works fine if I substitute the run1.Resp.1D and use the run2.ECG.1D file, so I know it's not a problem with all of the run2 data. The run2.Resp.1D file is the correct length, and looks normal from a visual perspective.
I'm happy to share the Resp.1D and ECG.1D files if necessary.
Any ideas?