Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: undefined input argument of a user defined function
Date: Wed, 27 Mar 2013 16:58:06 +0000 (UTC)
Organization: Mitre Corp
Lines: 27
Message-ID: <kiv8eu$1bq$1@newscl01ah.mathworks.com>
References: <kiuteg$mbe$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-05-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1364403486 1402 172.30.248.37 (27 Mar 2013 16:58:06 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 27 Mar 2013 16:58:06 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2318
Xref: news.mathworks.com comp.soft-sys.matlab:792102

"anurag" wrote in message <kiuteg$mbe$1@newscl01ah.mathworks.com>...
> i'm using the following code to create a function::
> 
> function [z]=maxtheta(A0,A1,h)
> m=size(A0);
> n=size(h);
> t1=0;
> for j=1:n(2);
>     t2=t1+h(j);
>      for i=1:m(1);
>          a0=A0(i,j);
>          a1=A1(i,j);
>          z=feval(maxii,a0,a1,t1,t2);
>      end
>      t1=t1+t2;
> end
> end
> 
> where maxii is a function created by me and works fine with numerical values...now maxtheta suppose to take A0,A1,h as matrix inputs...but after defining A0,A1,h in command line when i am trying to run this function this is giving error message ::
> input argument h is not defined, input argument a0(not A0) is not defined.....plzz help...i need it urgent

If you are getting an error saying that h is not defined, then I would first suggest looking at how you are calling maxtheta from your workspace or command line.  Are you calling maxtheta with only two input arguments?

doc nargin
doc varargin

may help you.