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!
