How can i interpolate A and B to get C at a range of instance of A and B?

1 view (last 30 days)
A B C
1000 19,3 401,7
1000 30,9 340,1
1000 74,5 279,2
1000 84,6 270,7
1000 91,7 271
1200 41,5 320,1
1200 72,4 276,7
1200 82,2 272,6
1200 93,8 266,4
1200 102,9 263,6
1400 121 263,6
1400 137 268,8
  6 Comments
Walter Roberson
Walter Roberson on 9 Oct 2018
scatteredInterpolant()
But first you are going to have challenges reading the data file which appears to be using comma for the decimal place. What is the file format, and can you attach a sample of it so we can program a fix for your file format? Also which release are you using?
Shubham Mohan Tatpalliwar
Edited: Stephen23 on 9 Oct 2018
function [Kraftstoffverbrauch,Drehzahl,Drehmoment,Geschwindigkeit,DrehmomentAchse]=Kasus2_1(Drehzahl,Drehmoment)
% Modify the dimensions
nx = length(Drehzahl) ;
ny = length(Drehmoment) ;
[num] = xlsread('Mappe2.xlsx') ;
Dz = num(:,1) ; Dz(isnan(Dz))= [ ];
Dm = num(:,2) ;Dm(isnan(Dm))= [ ];
Kv = num(:,3) ;Kv(isnan(Kv))= [ ];
F = scatteredInterpolant([Dz Dm],Kv);
for i= 1:1:nx
for j= 1:1:ny
Kraftstoffverbrauch(i,j) = F(Drehzahl(i),Drehmoment(j));
end
Geschwindigkeit= (Drehzahl/(1.534*2.64))*2.037*0.06;
DrehmomentAchse= (Drehmoment*1.534*2.64);
end
this the program but the result is not satisfactory.... so i want to go for any other method

Sign in to comment.

Accepted Answer

KSSV
KSSV on 9 Oct 2018
[num,txt,raw] = xlsread('Mappe2.xlsx') ;
x = num(:,1) ; y = num(:,2) ; z = num(:,3) ;
N = 100 ;
[X,Y] = meshgrid(linspace(min(x),max(x),N),linspace(min(y),max(y),N)) ;
Z = griddata(x,y,z,X,Y) ;
surf(X,Y,Z);
shading interp
hold on
plot3(x,y,z,'.r')

More Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!