필터 지우기
필터 지우기

help need im my code

조회 수: 2 (최근 30일)
Kidist Getu
Kidist Getu 2016년 11월 8일
답변: Jan 2016년 11월 8일
NA= 1*10^18;
ND= 5*10^17;
phi= 0.913;
l=6*10^--9;
w=11*10^-9;
t=1.1*10^-9;
go= 5.7*10^-8;
es= 1.053*10^-12;
q=1.6*10^-19;
for vg= (0 -1 -2 -3 -4 -5 );
vd= (q*Nd*t^2 )./(phi-vg);
Id= Go*(((q*ND*t^2)/6*es)-(phi-vg)*(1-0.667*((2*es*(phi-vg))/(q*ND*t^2))^0.5);
disp(Vd);
disp(ID);
end
Vd=[-0.91 -1.91 -2.91 -3.91 -4.91 -5.91 ];
ID = [1.09*10^5 3.31*10^5 6.22 *10^5 9.67*10^5 1.36 *10*6 1.8*10^6 ];

답변 (3개)

Guillaume
Guillaume 2016년 11월 8일
Of course it's not running
vg= (0 -1 -2 -3 -4 -5 )
is not valid syntax. Perhaps you meant:
vg = [0 -1 -2 -3 -4 -5]
which could be simply written
vg = 0:-1:-5
Then,
Id= Go*(((q*ND*t^2)/6*es)-(phi-vg)*(1-0.667*((2*es*(phi-vg))/(q*ND*t^2))^0.5);
is missing a closing parentheses somewhere.
The error messages that matlab is giving you do tell you what is wrong.

KSSV
KSSV 2016년 11월 8일
clc; clear all ;
NA= 1*10^18;
ND= 5*10^17;
phi= 0.913;
l=6*10^--9;
w=11*10^-9;
t=1.1*10^-9;
go= 5.7*10^-8;
es= 1.053*10^-12;
q=1.6*10^-19;
VG = [0 -1 -2 -3 -4 -5] ;
vd = zeros(size(VG)) ;
Id = zeros(size(VG)) ;
for i = 1:length(VG)
vg = VG(i) ;
vd(i)= (q*ND*t^2 )./(phi-vg);
Id(i)= go*(((q*ND*t^2)/6*es)-(phi-vg)*(1-0.667*((2*es*(phi-vg))/(q*ND*t^2))^0.5));
end
Vd=[-0.91 -1.91 -2.91 -3.91 -4.91 -5.91 ];
ID = [1.09*10^5 3.31*10^5 6.22 *10^5 9.67*10^5 1.36 *10*6 1.8*10^6 ];

Jan
Jan 2016년 11월 8일
There is an unintented "-" in:
l=6*10^--9;
It is not an error, but more efficient not to perform the power operation explicitely, because it is very expensive. Much faster:
l = 6e-9;
This is a constant and does not require any processing time during the execution.

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by