Effacer les filtres
Effacer les filtres

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

1 vue (au cours des 30 derniers jours)
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 commentaires
Walter Roberson
Walter Roberson le 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
Modifié(e) : Stephen23 le 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

Connectez-vous pour commenter.

Réponse acceptée

KSSV
KSSV le 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')

Plus de réponses (0)

Catégories

En savoir plus sur Interpolation dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by