Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: function

Subject: function

From: J V

Date: 08 Jan, 2008 00:39:02

Message: 1 of 2

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?

Subject: Re: function

From: Roger Stafford

Date: 08 Jan, 2008 00:59:04

Message: 2 of 2

"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
 

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics