MATLAB: The plot doesn’t appear

plot

function [rpm] = fun1(rpm)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
rpm=1000:1:7000;
bore=0.1;%m

stroke=0.1;%m
Vd=4*(pi/4)*(bore^2)*stroke;
MW=28.97;%kg/kmol
R=8.314;%j/K.Kmol
AFR=14.6;
LHV=43*10^3; %(j/kg)
GIE=0.4;%
Pi=95;%kpa
Ti=330;%K
Pe=110;%Kpa

PMEP=15;%Kpa
Nvol=2*(10^-12)*((rpm).^3)-5*(10^-8)*((rpm).^2)+0.0003*(rpm)+0.45;
FMEP=57+0.015*(rpm)+5.5*(10^-6)*(rpm).^2;
density = (Pi/((R/MW)*Ti));
IMEPg=GIE*density*Nvol*LHV/AFR;
IMEPn = (GIE*density*Nvol*LHV)/AFR -PMEP;
BMEP = IMEPn-FMEP;
%disp(Vd);
Wb=BMEP*Vd;
Tb=Wb*1000/(4*pi);
mf=(Vd*density*Nvol)/AFR;
BTE=Wb/(mf*LHV);
GIE=(IMEPg*Vd)/(mf*LHV);
NIE=(IMEPn*Vd)/(mf*LHV);
%disp(IMEPn);
%disp(BMEP);
%plot(rpm,BMEP);
%plot(rpm,Wb);
plot(rpm,GIE);
disp(BTE);
end
The plot doesn't appear for BTE, and NIE again the RPM
Could you please help me to solve this issue ASAP.
Thanks

Best Answer

I believe you were doing some matrix division instead of element-wise division when you defined GIE and NIE. This will result in a single value for those variables, instead of vectors. Try this instead:
GIE=(IMEPg*Vd)./(mf*LHV);
NIE=(IMEPn*Vd)./(mf*LHV);
Notice that I added the dots for the division. See, for example, this documentation.
I think you might have some other issues, too, given what the output looks like, but maybe you can figure that out.