Tags: 1us-0, 1while, 23e17a0, 5n_r2, 719ub-16, 8step0, 9u_max470, arguments, below, input, j1u_min44, matlab, programming, run

Not enough input arguments.

On Programmer » Matlab

4,837 words with 2 Comments; publish: Sun, 18 May 2008 21:48:00 GMT; (200218.75, « »)

Hi,all,

I am trying to run the below :

j=1;

U_min=44.9;

U_max=470.5;

N_r=2.23e17;

a=0.719;

ub=-16.8;

step=0.1;

us=-0.1;

while us >ub

i=1;

res=0;

u=us-step;

upper=ub;

while u>upper

g= quad('ee',u,us);

y=g*2.84e-5

surface_potential=u;

surface_bending=u-ub;

charge_density=2E17*exp(-surface_bending);

C(i,1)=y;

C(i,2)=u;

C(i,3)=charge_density;

mobility=U_min+(U_max-U_min)/(1+(charge_density/N_r)^a);

C(i,4)=mobility;

C(i,5)=(charge_density*mobility*1.6e-19);

C(i,6)=1/C(i,5);

if i >1

mm=C(i,1)-C(i-1,1);

C(i,7)=mm*100;

real=C(i,6);

dxResistance=real*C(i,7);

C(i,8)=dxResistance;

res=res+dxResistance;

end

i=i+1;

u=u-step;

end

areares(j,1)=us;

areares(j,2)=res*2.5e3;

j=j+1;

us=us-step;

end

%save c2.txt C -ascii -double;

save r2.txt areares -ascii -double;

Got a error message says"Not enough input arguments." what does it

mean?

regards,

tao

All Comments

Leave a comment...

  • 2 Comments
    • one of the great things about Matlab is it will point you to the

      portion of your code that is wrong. Why don't you only paste that

      code. This way we don't have to read the whole thing.

      Also, you should try not to use the variables j or i as indices in

      MatLab. They are already assigned the value of sqrt(-1)

      tao wrote:

      >

      > Hi,all,

      > I am trying to run the below :

      > j=1;

      > U_min=44.9;

      > U_max=470.5;

      > N_r=2.23e17;

      > a=0.719;

      > ub=-16.8;

      > step=0.1;

      > us=-0.1;

      > while us >ub

      > i=1;

      > res=0;

      > u=us-step;

      > upper=ub;

      > while u>upper

      > g= quad('ee',u,us);

      > y=g*2.84e-5

      > surface_potential=u;

      > surface_bending=u-ub;

      > charge_density=2E17*exp(-surface_bending);

      > C(i,1)=y;

      > C(i,2)=u;

      > C(i,3)=charge_density;

      > mobility=U_min+(U_max-U_min)/(1+(charge_density/N_r)^a);

      > C(i,4)=mobility;

      > C(i,5)=(charge_density*mobility*1.6e-19);

      > C(i,6)=1/C(i,5);

      > if i >1

      > mm=C(i,1)-C(i-1,1);

      > C(i,7)=mm*100;

      > real=C(i,6);

      > dxResistance=real*C(i,7);

      > C(i,8)=dxResistance;

      > res=res+dxResistance;

      >

      > end

      > i=i+1;

      > u=u-step;

      > end

      > areares(j,1)=us;

      > areares(j,2)=res*2.5e3;

      > j=j+1;

      > us=us-step;

      > end

      > %save c2.txt C -ascii -double;

      > save r2.txt areares -ascii -double;

      > Got a error message says"Not enough input arguments." what does it

      > mean?

      > regards,

      > tao

      #1; Sun, 18 May 2008 21:49:00 GMT
    • In article <ef57011.-1.matlab.todaysummary.com.webcrossing.raydaftYaTP>, tao

      <bigworld005.matlab.todaysummary.com.yahoo.com> wrote:

      > Hi,all,

      > I am trying to run the below :

      > j=1;

      > U_min=44.9;

      > U_max=470.5;

      > N_r=2.23e17;

      > a=0.719;

      > ub=-16.8;

      > step=0.1;

      > us=-0.1;

      > while us >ub

      > i=1;

      > res=0;

      > u=us-step;

      > upper=ub;

      > while u>upper

      > g= quad('ee',u,us);

      > y=g*2.84e-5

      > surface_potential=u;

      > surface_bending=u-ub;

      > charge_density=2E17*exp(-surface_bending);

      > C(i,1)=y;

      > C(i,2)=u;

      > C(i,3)=charge_density;

      > mobility=U_min+(U_max-U_min)/(1+(charge_density/N_r)^a);

      > C(i,4)=mobility;

      > C(i,5)=(charge_density*mobility*1.6e-19);

      > C(i,6)=1/C(i,5);

      > if i >1

      > mm=C(i,1)-C(i-1,1);

      > C(i,7)=mm*100;

      > real=C(i,6);

      > dxResistance=real*C(i,7);

      > C(i,8)=dxResistance;

      > res=res+dxResistance;

      >

      > end

      > i=i+1;

      > u=u-step;

      > end

      > areares(j,1)=us;

      > areares(j,2)=res*2.5e3;

      > j=j+1;

      > us=us-step;

      > end

      > %save c2.txt C -ascii -double;

      > save r2.txt areares -ascii -double;

      > Got a error message says"Not enough input arguments." what does it

      > mean?

      > regards,

      > tao

      --

      As nearly as I can make out, the problem comes with the line:

      dxResistance=real*C(i,7);

      Even though you named a variable 'real', matlab has apparently called on

      the 'real' function instead and wants to know what variable you want the

      real part of. Actually my own version (4a) calmly reassigns 'real' to the

      indicated value and from then on the 'real' function doesn't work

      properly. In any case, you should never use the name 'real' for a

      variable in order to avoid rude surprises like this. The same applies to

      other matlab constants such as, 'eps', 'i', 'j', 'pi', 'realmax', etc.

      Roger Stafford

      #2; Sun, 18 May 2008 21:50:00 GMT