Data interpolation from graph
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Manish Kumar
am 20 Mär. 2019
Bearbeitet: Andrea Monfredini
am 20 Mär. 2019
Dear Experts,
I have x1 (first column of Book1 excel sheet) and y1 (2nd column of excel sheet Book1). From this data I want to interpolate the y2 data for the x2 (1st column of excel sheet Book2). How to do it ?
0 Kommentare
Akzeptierte Antwort
Andrea Monfredini
am 20 Mär. 2019
Bearbeitet: Andrea Monfredini
am 20 Mär. 2019
n = 10; %the sample size
x1 = linspace(0,5,n); %this is to simulate your x1
y1 = rand(1,n); %this is to simulate your y1
p = polyfit(x1,y1,n)
x2 = linspace(0,5,10000); %this is to simulate x2, that should be the domain of the interpolating function
y2 = polyval(p,x2)
scatter(x1,y1)
hold on;
plot(x2,y2)
0 Kommentare
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!