Re: what am i doing wrong?
- To: mathgroup at smc.vnet.net
- Subject: [mg94533] Re: what am i doing wrong?
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Mon, 15 Dec 2008 07:49:27 -0500 (EST)
- Organization: The Open University, Milton Keynes, UK
- References: <gi2usp$a53$1@smc.vnet.net>
stpatryck wrote: > In[111]:= npv[cf0_, cf1_, cf2_, cf3_, cf4_, cf5_] := -(cf0) + > cf1*(1/((1.12)^1)) + cf2*(1/((1.12)^2)) + cf3*(1/((1.12)^3)) + > cf4*(1/((1.12)^4)) + cf5*(1/((1.12)^5)); > > (* Plan A NPV *) > npv[3600000, 0, 0, 0, 0, 7000000] > > SetDelayed::write: Tag Real in 1304.33[cf0_,cf1_,cf2_,cf3_,cf4_,cf5_] > is Protected. >> > > Out[111]:= 1304.33[3600000, 0, 0, 0, 0, 7000000] The symbol 'npv' has already been assigned a value (a numeric value, 1304.22 in this case) so you must clear this value first. In[6]:= ClearAll[npv] npv[cf0_, cf1_, cf2_, cf3_, cf4_, cf5_] := -(cf0) + cf1*(1/((1.12)^1)) + cf2*(1/((1.12)^2)) + cf3*(1/((1.12)^3)) + cf4*(1/((1.12)^4)) + cf5*(1/((1.12)^5)); (*Plan A NPV*) npv[3600000, 0, 0, 0, 0, 7000000] Out[8]= 371988. Regards, -- Jean-Marc