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

1 次查看(过去 30 天)
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 个评论
Walter Roberson
Walter Roberson 2018-10-9
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
编辑:Stephen23 2018-10-9
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

请先登录,再进行评论。

采纳的回答

KSSV
KSSV 2018-10-9
[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')

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interpolation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by