index error for find function
Ältere Kommentare anzeigen
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 Kommentar
Dishant Arora
am 6 Mär. 2014
You might have to go for interpolation to get the value at non- integral coordinates.
Akzeptierte Antwort
Weitere Antworten (2)
Chandrasekhar
am 6 Mär. 2014
k = find(newf == 14.6484);
ppks = Signal_fft_hilbert(k);
17 Kommentare
ankita
am 6 Mär. 2014
Chandrasekhar
am 6 Mär. 2014
ok, but the index should be a scalar value. is there any relation between newf and Signal_fft_hilber?
ankita
am 6 Mär. 2014
Chandrasekhar
am 6 Mär. 2014
does frequency at index1 of newf correspond to amplitude at index 1 of signal_fft_hilbert?
ankita
am 6 Mär. 2014
Chandrasekhar
am 6 Mär. 2014
k= find(newf==14.6484) this statement should give k = ,because the first element of newf is 14.6484

ankita
am 6 Mär. 2014
Chandrasekhar
am 6 Mär. 2014
Please find the data attached that i am using
ankita
am 6 Mär. 2014
Chandrasekhar
am 6 Mär. 2014
copy the file and load it into your matlab workspace. load('Data.mat'); have you done the same?
ankita
am 6 Mär. 2014
Chandrasekhar
am 6 Mär. 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
am 6 Mär. 2014
Chandrasekhar
am 6 Mär. 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
am 6 Mär. 2014
Chandrasekhar
am 6 Mär. 2014
the code(anki.m) doesnt execute. it is giving errors.
ankita
am 6 Mär. 2014
Niklas Nylén
am 6 Mär. 2014
Bearbeitet: Niklas Nylén
am 6 Mär. 2014
0 Stimmen
I misunderstood the question, removed my response but kept the answer to not lose the comments below.
3 Kommentare
ankita
am 6 Mär. 2014
Chandrasekhar
am 6 Mär. 2014
can you share the data of aa1 and Signal_fft_hilbert
ankita
am 6 Mär. 2014
Kategorien
Mehr zu Creating, Deleting, and Querying Graphics Objects finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
