Path: news.mathworks.com!not-for-mail
From: "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid>
Newsgroups: comp.soft-sys.matlab
Subject: Re: function
Date: Tue, 8 Jan 2008 00:59:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 34
Message-ID: <fluhso$7df$1@fred.mathworks.com>
References: <flugn6$quj$1@fred.mathworks.com>
Reply-To: "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1199753944 7599 172.30.248.38 (8 Jan 2008 00:59:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 8 Jan 2008 00:59:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:444761


"J V" <vlchsjstn@yahoo.com> wrote in message <flugn6$quj
$1@fred.mathworks.com>...
> function Is = h()
> 
>     g()
>     Is = (Ae*q*Dn*(Ni^2))/(Na*W);
> 
> return;
> 
> function [Ae q Dn W Ni Na]=g()
>     Ae = input('cross-sectional area of the base-emitter 
> junction(in the direction perpendicular to the page? (Ae 
> cm^2) ');
>     q = input('magnitude of the electron charge? (q 
> Coulomb) ');
>     Dn = input('electron diffusivity in the base? (Dn 
> cm^2/s) ');
>     W = input('effective width of the base? (W cm) ');
>     Ni = input('intrinsic carrier density? (ni 1/cm^3) ');
>     Na = input('doping concentration in the base? (Na 
> 1/cm^3) ');
> 
> return;
> 
> why does this function giving me an error?
-------
You haven't brought in the six variables in your call to g().  It should be:

  [Ae, q, Dn, W, Ni, Na]=g();

The function 'h' doesn't  know these variables' values unless you do.

Roger Stafford