index error for find function
Afficher commentaires plus anciens
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 commentaire
Dishant Arora
le 6 Mar 2014
You might have to go for interpolation to get the value at non- integral coordinates.
Réponse acceptée
Plus de réponses (2)
Chandrasekhar
le 6 Mar 2014
k = find(newf == 14.6484);
ppks = Signal_fft_hilbert(k);
17 commentaires
ankita
le 6 Mar 2014
Chandrasekhar
le 6 Mar 2014
ok, but the index should be a scalar value. is there any relation between newf and Signal_fft_hilber?
ankita
le 6 Mar 2014
Chandrasekhar
le 6 Mar 2014
does frequency at index1 of newf correspond to amplitude at index 1 of signal_fft_hilbert?
ankita
le 6 Mar 2014
Chandrasekhar
le 6 Mar 2014
k= find(newf==14.6484) this statement should give k = ,because the first element of newf is 14.6484

ankita
le 6 Mar 2014
Chandrasekhar
le 6 Mar 2014
Please find the data attached that i am using
ankita
le 6 Mar 2014
Chandrasekhar
le 6 Mar 2014
copy the file and load it into your matlab workspace. load('Data.mat'); have you done the same?
ankita
le 6 Mar 2014
Chandrasekhar
le 6 Mar 2014
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
le 6 Mar 2014
Chandrasekhar
le 6 Mar 2014
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
le 6 Mar 2014
Chandrasekhar
le 6 Mar 2014
the code(anki.m) doesnt execute. it is giving errors.
ankita
le 6 Mar 2014
Niklas Nylén
le 6 Mar 2014
Modifié(e) : Niklas Nylén
le 6 Mar 2014
0 votes
I misunderstood the question, removed my response but kept the answer to not lose the comments below.
3 commentaires
ankita
le 6 Mar 2014
Chandrasekhar
le 6 Mar 2014
can you share the data of aa1 and Signal_fft_hilbert
ankita
le 6 Mar 2014
Catégories
En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
