Matlab dimensions must agree error -
%%pmos cox = 10; co = .25; cjo = .6 ; mj = .3 ; phi_b = 1; cjswo = 0.066; mjsw = 0.1 ; phi_bsw = .5 ; ls = 240000 ; w = 20 ; vd = 0:0.1:1 ; %%%%% **cj = cjo/((1-(vd/phi_b))).^mj;** cjsw = cjswo/((1-(vd/phi_bsw))).^mjsw; %%%%%%%%%%%% cdiff_pmos = cj*ls*w + cjsw*(2*ls + w); plot(vd,cdiff_pmos);
the error shows is
error using / matrix dimensions must agree. error in p4_ee115_hw1 (line 14) cj = cjo/((1-(vd/phi_b))).^mj;
any tips on how fix apprecitated. .
if put ./
on line cj
, cjsw
work. so:
cj = cjo./((1-(vd/phi_b))).^mj; cjsw = cjswo./((1-(vd/phi_bsw))).^mjsw;
you getting error because trying divide scalar vector , matlab picky this. want element wise ./
, remedy code.
Comments
Post a Comment