how to get a expected plot for these values?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Shubham Mohan Tatpalliwar
el 1 de Oct. de 2018
Comentada: Shubham Mohan Tatpalliwar
el 1 de Oct. de 2018
function [Kraftstoffverbrauch,Wi, Drehzahl, Drehmoment]=Kasus_1_4(Drehzahl, Drehmoment) % Modify the dimensions nx = length(Drehzahl) ; ny = length(Drehmoment) ;
if nx > ny Drehmoment = linspace(min(Drehmoment),max(Drehmoment),nx ) ; elseif nx<ny Drehzahl = linspace(min(Drehzahl),max(Drehzahl),ny) ; end [num,txt,raw] = xlsread('Mappe1.xlsx') ; Dz = num(:,1) ; Dz(isnan(Dz))= [ ]; A = num(:,2:end) ; A(isnan(A(:,1)),:)= [] ; W = A(1:2:end,:) ; Dm = A(2:2:end,:) ; Dz1 = repmat(Dz,1,size(Dm,1)) ; idx = ~isnan(Dm) ; F = scatteredInterpolant([Dz1(idx) Dm(idx)],W(idx));
Wi = F(Drehzahl,Drehmoment);
Drehmoment2 = Drehmoment*3.0769*2.64; Geschwindigkeit= (Drehzahl/(3.07*2.64))*2.037*0.06; Kraftstoffverbrauch= (2*3.14*(Drehmoment).*(Drehzahl))./(Wi*0.98*0.8.*(Geschwindigkeit)*600); plot3(Drehzahl,Drehmoment,Kraftstoffverbrauch) xlabel ('Drehzahl(1/min)');ylabel ('Drehmoment(N.m)'); zlabel ('Kraftstoffverbrauch(kWh/100km)'); title ('Drehmoment vs Drehzahl Diagram'); end
8 comentarios
JohnGalt
el 1 de Oct. de 2018
aside from the labelling... the issue is that your inputs scale linearly with each other ... so of course you're going to get a straight line...
Respuesta aceptada
KSSV
el 1 de Oct. de 2018
Should try something like this:
[num,txt,raw] = xlsread('Mappe1.xlsx') ;
% [num,txt,raw] = xlsread('Mappe1.xlsx') ;
x = num(:,1) ; x(isnan(x))= [ ];
A = num(:,2:end) ;
A(isnan(A(:,1)),:)= [] ;
Y = A(1:2:end,:) ;
Z = A(2:2:end,:) ;
X = repmat(x,1,size(Y,1)) ;
contour(X,Y,Z','ShowText','on')
3 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Line Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!