How to overcome an error 'Subscript indices must either be real positive integers or logicals' when using mspalign function'?

조회 수: 3 (최근 30일)
When I'm using mspalign to align my peaks (GC-MS) then an error generated as 'Subscript indices must either be real positive integers or logicals' when using mspalign function' .I've google for any solution regarding on this error. I've found out this happen because the indices contain floating points. Unfortunately my data contains floating points for the m/z value. However, when I'm referring the example dataset use in MATLAB help, its appear to have floating point to m/z value too.I'm also change few parameters in mspalign such as quantile, estimationmethod and correctionmethod. This also doesn't work but new error appear when changing estimationmethod to regression since not enough point to calculate common grid in mz scale.
Can anyone help me understand what's going on? If you need the data I'll send to your through email or any way.
  댓글 수: 2
ES
ES 2014년 1월 13일
It should be simple to solve this. Can you please post your formatted code?
nur zawatil isqi
nur zawatil isqi 2014년 1월 13일
Thank you Chocolate Warrior. Here the code. [CMZ, aligned_peaks] = mspalign(peaks);
I had found the solution. I had try changing numbers of quantile value with 3 decimal place. Here the codes
i=0;
while i<1
try
[CMZ, aligned_peaks] = mspalign(peaks,'quantile',i); catch err if (strcmp(err.identifier,'MATLAB:badsubscript')) disp(i) i=i+0.001;
else
rethrow(err);
end
end %end catch
end

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by