How do I Interpolate on an array
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
For the analysis of quite a large amount of data, I want to measure the distance between 2 pixels on DICOM image, with the same HU-values, to get the length of an object. Currently I'm doing this manually in Excel with linear interpolation, but it's too much work.
A line plot over the object gives me this curve for example:
What I'm looking for is the two X-coordinates, or the distance between the two, where Y = -350.
I've tried to interpolate with interp1(X,Y,-350), but that just results in a error every time ==> The values of X should be distinct.
How can I do this with Matlab?
0 Kommentare
Akzeptierte Antwort
G A
am 13 Nov. 2013
X1=X(Y>=-350);
distance=X1(end)-X1(1);
if precision is not good enough you can interpolate the curve before this
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Interpolation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!