Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Interpolate in matlab

I have two realizations for (X,Y)

(0, 200)
(23, 700)

I want to find the value of Y at X1=12.5 with matlab with linear interpolation

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Would interp1 work? but haven’t figured out how to use the arguments

Thank you

>Solution :

This does the thing:

enter image description here

x = [0,23];
y = [200,700];
xq = 12.5;
yq = interp1(x,y,xq)

%visualization
plot(x,y);hold on;
stem(xq,yq,'r')
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading