Why does the Gaussian fit function become highly inaccurate after 24 iterations in a for loop?
조회 수: 2 (최근 30일)
이전 댓글 표시
I am attempting to fit 24 spectra corresponding with 24 files in a directory with MatLab's Gaussian fit function, 'gauss6'. These spectra are processed in a for loop that repeats for each file in the directory. The outputs of this loop are the optimized peak locations, intensities, etc. However, when MatLab attempts to perform the fit function for the 24th spectrum, the final peak's position (sixth) is completely incorrect, while the other five peaks are just as correct as the previous 23 spectra. This doesn't occur for directories of 23 files or less, but always happens to the final peak of the final spectrum if the number of spectra being fit is greater than 24.
Things I have tried:
- Given 25 spectra, the last peak of the 25th is incorrect. It's always the final peak of the last file/spectrum if the files are greater than 24.
- Isolating the 24th spectrum by itself yields a correct fitting.
- It seems like the R^2 gets worse slowly as the number of spectra being fit increases.
댓글 수: 3
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Spectral Estimation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!