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!
