Hi , I am using forth order RK method to solve my probolem.But while calling one subfunction MRG.m to main function i am getting error message
Output argument "D" (and maybe others) not assigned during call to"E:\PRO\NNEWPTR\MRG.m>MRG".
I have tried by using link http://www.mathworks.com/matlabcentral/answers/97825-why-do-i-get-the-error-output-argument-variable-and-maybe-others-not-assigned-during-call-t but unable to solve it.
here is the code of MRG.m
function [D]= MRG(p_cp,p_t)rho=2.389;drg=.032;dh=.04E-3;lrg=.8;mu=15.21E-6;phi=.7;r=2074;t1=(rho*pi*drg*drg*dh*dh)/(600*lrg*mu);t2=(phi*phi*phi)/(1-phi);if(p_cp>p_t) D=t1*t2*(p_cp-p_t);elseif(p_cp>p_t) D=t1*t2*(p_t-p_cp);elseif(p_cp==p_t) D=0;end
The main function code which is related to this function is
for m=1:1:100 v_cp=vo+(0.5*vs*(1+sin(omega*t(m)))); v_cpdot=vs*pi*f*cos(omega*t(m)); m_o=MO(p_t(m),p_r(m)); m_rg=MRG(p_cp(m),p_t(m));end,
Actually it is a part of code of main function,I have not attached the detailed code becz it will be difficult to understtod if required i will send.
plz help……………
Best Answer