if true % code
function [Kraftstoffverbrauch, Drehzahl, Drehmoment]=Kasus2_1(Drehzahl, Drehmoment)% Modify the dimensions
nx = length(Drehzahl) ; ny = length(Drehmoment) ; if nx > ny Drehmoment1 = linspace(min(Drehmoment),max(Drehmoment),nx ) ; elseif nx<ny Drehzahl1 = linspace(min(Drehzahl),max(Drehzahl),ny) ;end[num,txt,raw] = 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:nxfor j= 1:1:nyKraftstoffverbrauch (i,j) = F(Drehzahl(i),Drehmoment(j));endendsurf(Drehzahl,Drehmoment,Kraftstoffverbrauch'),xlabel ('Drehzahl(1/min)');ylabel ('Drehmoment(N.m)'); zlabel ('Kraftstoffverbrauch(kWh/100km)');title ('Drehmoment vs Drehzahl Diagram');end
The display of he expected limits can be sssn in the picture
Best Answer