index error for find function
이전 댓글 표시
I am trying to find the value of Signal_fft_hilbert at the values of newf. But i get the error:
??? Attempted to access Signal_fft_hilbert(14.6484); index must be a positive integer or logical.
I want to find the value at exactly 14.6484. How can I find the value?
newf=aa1(:)'
for s=1:length(newf)
ppks=find(Signal_fft_hilbert(newf(s)))
end
댓글 수: 1
Dishant Arora
2014년 3월 6일
You might have to go for interpolation to get the value at non- integral coordinates.
채택된 답변
추가 답변 (2개)
Chandrasekhar
2014년 3월 6일
k = find(newf == 14.6484);
ppks = Signal_fft_hilbert(k);
댓글 수: 17
ankita
2014년 3월 6일
Chandrasekhar
2014년 3월 6일
ok, but the index should be a scalar value. is there any relation between newf and Signal_fft_hilber?
ankita
2014년 3월 6일
Chandrasekhar
2014년 3월 6일
does frequency at index1 of newf correspond to amplitude at index 1 of signal_fft_hilbert?
ankita
2014년 3월 6일
Chandrasekhar
2014년 3월 6일
k= find(newf==14.6484) this statement should give k = ,because the first element of newf is 14.6484

ankita
2014년 3월 6일
Chandrasekhar
2014년 3월 6일
Please find the data attached that i am using
ankita
2014년 3월 6일
Chandrasekhar
2014년 3월 6일
copy the file and load it into your matlab workspace. load('Data.mat'); have you done the same?
ankita
2014년 3월 6일
Chandrasekhar
2014년 3월 6일
Ok, you can use this data now. It is the same data that you had posted. what is the next step you have to do once you get the K value?
ankita
2014년 3월 6일
Chandrasekhar
2014년 3월 6일
can you save your data as .mat file and attach it. I will check it. Also let me know do you have data for Signal_fft_hilbert or it is only a graph that you have.
ankita
2014년 3월 6일
Chandrasekhar
2014년 3월 6일
the code(anki.m) doesnt execute. it is giving errors.
ankita
2014년 3월 6일
Niklas Nylén
2014년 3월 6일
편집: Niklas Nylén
2014년 3월 6일
0 개 추천
I misunderstood the question, removed my response but kept the answer to not lose the comments below.
댓글 수: 3
ankita
2014년 3월 6일
Chandrasekhar
2014년 3월 6일
can you share the data of aa1 and Signal_fft_hilbert
ankita
2014년 3월 6일
카테고리
도움말 센터 및 File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
