Path: news.mathworks.com!newsfeed-00.mathworks.com!panix!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!elk.ncren.net!newsflash.concordia.ca!canopus.cc.umanitoba.ca!not-for-mail
From: Walter Roberson <roberson@hushmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Newton-Raphson
Date: Thu, 08 Apr 2010 18:21:07 -0500
Organization: Canada Eat The Cookie Foundation
Lines: 33
Message-ID: <hplod5$le9$1@canopus.cc.umanitoba.ca>
References: <hf6s0i$bhl$1@fred.mathworks.com> <hpl2a7$cka$1@fred.mathworks.com> <hpl3jj$jm7$1@canopus.cc.umanitoba.ca> <hpl4no$ode$1@fred.mathworks.com> <hpl9do$sai$1@canopus.cc.umanitoba.ca> <hplhhm$qpo$1@fred.mathworks.com> <hpljpa$ecm$1@canopus.cc.umanitoba.ca> <hplkne$fbu$1@fred.mathworks.com> <hpllok$hac$1@canopus.cc.umanitoba.ca> <hplnb9$mgb$1@fred.mathworks.com>
NNTP-Posting-Host: ibd-nat.ibd.nrc.ca
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: canopus.cc.umanitoba.ca 1270768869 21961 192.70.172.18 (8 Apr 2010 23:21:09 GMT)
X-Complaints-To: abuse@cc.umanitoba.ca
NNTP-Posting-Date: Thu, 8 Apr 2010 23:21:09 +0000 (UTC)
User-Agent: Thunderbird 2.0.0.24 (X11/20100317)
In-Reply-To: <hplnb9$mgb$1@fred.mathworks.com>
Xref: news.mathworks.com comp.soft-sys.matlab:624866

Muhamad wrote:
> Walter Roberson <roberson@hushmail.com> wrote in message 
> <hpllok$hac$1@canopus.cc.umanitoba.ca>...

>> When you have a function, the only values that you can use in the 
>> function are numeric constants, named constants such as pi, values you 
>> have already computed in the routine, and values that you have named 
>> after the '(' on the 'function' line.

> why but still error ?
> ------
> ??? Input argument 'teta' is undefined.
> 
> Error in ==> C:\Documents and Settings\madz\My 
> Documents\Downloads\elda\func.m
> On line 4  ==> f = cos(A)-sin(teta)*e^(-(180+A-teta)/W*R);
> 
> Error in ==> C:\Documents and Settings\madz\My 
> Documents\Downloads\elda\Newton_Raphson.m
> On line 11  ==> while (iterations<30) & (abs(func(x))>tolerance)

If we look at that last error message, we see that you are calling func() 
passing in only x. Inside func, you attempt to use teta. Review the paragraph 
I have quoted above. Is teta a numeric literal, a named constant such as pi, a 
value already computed in func(), or a variable you have named after the '(' 
of the 'function' line of func()? If the latter, have you passed in a value 
for teta from the calling routine?


I never claimed to have fixed all of the problems in your code: I showed you 
what was wrong with a particular routine and why, and assumed you would be 
apply to take those explanations and apply the thought processes to your other 
routines and fix them yourself.