Subscript indices must either be real positive integers or logicals.pls help me with dis error
Show older comments
Subscript indices must either be real positive integers or logicals.
Error in ==> svlzfsig2>remTrend at 54
rm=rm(winSize/2:length(rm)-winSize/2);
Error in ==> svlzfsig2>zeroFreqFilter at 41
zfSig=remTrend(zfSig,winLength);
Error in ==> svlzfsig2 at 17
zf=zeroFreqFilter(wav,fs,winLength);
Error in ==> EpochsbyZFF at 40
[zsp1,gclocssp1,epssp1,f0sp1]=svlzfsig2(sp1sig,fs,winlength);
Error in ==> UVRegion at 10
[zsp1,epochlocs,vgclocssp1,vf0sp1,vepochstr]=EpochsbyZFF(s,Fs);
Error in ==> hari_new at 36
[epochlocs,vgclocssp1_3,UvRegion,vf0sp1_3,vepochstr]=UVRegion(part3,Fs);
Answers (2)
Wayne King
on 1 May 2013
You have to tell us what the sizes are of the variables in
rm=rm(winSize/2:length(rm)-winSize/2);
put a breakpoint in the code at that line and see what the dimensions are of rm and winSize
Image Analyst
on 1 May 2013
0 votes
winSize is probably an odd number, like 5, so winSize/2 would be a fractional number like 2.5. There is no 2.5th element of the array. There is element #2 and element #3. You have to decide to use only even window sizes, or decide what to do in the case of an odd sized window.
4 Comments
Sony
on 2 May 2013
Walter Roberson
on 2 May 2013
Whatever code is constructing the value that gets written into winSize: change that code so that it only allows even numbers.
Sony
on 3 May 2013
Image Analyst
on 3 May 2013
When you call zeroFreqFilter(), just make sure the third argument is 2, 4, 6, 8, or any other even number. Make sure it's not 3, 5, 7, 9, or any other odd number because your program does not like that. I'm really not sure why you ask "how to to use only even window sizes?" - isn't it obvious? Or am I missing something?
Categories
Find more on Multirate Signal Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!