MATLAB error: input argument "x" undefined -



MATLAB error: input argument "x" undefined -

i've got little matlab function i'm attempting run calling command line, follows:

??? input argument "x" undefined.

for reference, "main" function:

function f = dsr(x) x(1); x(2); x(3); rho=1.2041; mu=1.81625e-5; re=30; pref=[10,10,10]; leakagearea=[x(1) x(2) x(3)]; i=1:3; turb(i)=2^0.5*0.6*leakagearea(1,i)*pref(1,i)^((1-2*0.65)/2); ftrans=mu*re*leakagearea(1,i)^0.5; ptrans=(ftrans/(turb(i)*rho^0.5))^(1/0.65); lam(i)=mu*ftrans/(rho*ptrans); end; input1=[lam(1,1) turb(1,1) 0.65 0.611 10 x(1) 0 0 2 2 2 0]; input2=[lam(1,2) turb(1,2) 0.65 0.611 10 x(2) 0 0 2 2 2 0]; input3=[lam(1,3) turb(1,3) 0.65 0.611 10 x(3) 0 0 2 2 2 0]; airflow=fopen('130109ex1.prj','rt+'); if(airflow==-1); errordlg('airflow open error','error'); end; i=1:11614; fid=fgetl(airflow); if(strcmp(upper(fid),upper('1 23 plr_leak1 double_door'))==1); filepositon=ftell(airflow); break; end; sprintf('다시'); end; fid=fgetl(airflow); fseek(airflow,1,'cof'); fprintf(airflow,'%6.5e %5.4f %3.2f %4.3f %d %5.4f %d %d %d %d %d %d\n',input1); fclose(airflow); airflow=fopen('130109ex1.prj','rt+'); if(airflow==-1); errordlg('airflow open error','error'); end; i=1:11614; fid=fgetl(airflow); if(strcmp(upper(fid),upper('2 23 plr_leak1 ev_door'))==1); filepositon=ftell(airflow); break; end; sprintf('다시'); end; fid=fgetl(airflow); fseek(airflow,1,'cof'); fprintf(airflow,'%6.5e %6.5f %3.2f %3.2f %d %5.4f %d %d %d %d %d %d\n',input2); fclose(airflow); airflow=fopen('130109ex1.prj','rt+'); if(airflow==-1); errordlg('airflow open error','error'); end; i=1:11614; fid=fgetl(airflow); if(strcmp(upper(fid),upper('7 23 plr_leak1 single_door'))==1); filepositon=ftell(airflow); break; end; sprintf('다시'); end; fid=fgetl(airflow); fseek(airflow,1,'cof'); fprintf(airflow,'%6.5e %6.5f %3.2f %4.3f %d %5.4f %d %d %d %d %d %d\n',input3); fclose(airflow); dos('contamx2 130109ex1.prj'); dos('simread_ysm 130109ex1.sim'); output=fopen('130109ex1.lfr','rt'); a=textscan(output, '%s %s %s %s %s %s'); mm=a{1,4}; a0=str2double(mm(84+2,1)); %x1: 1층 외피 (..+2는 왜하는 거지 ?) a1=str2double(mm(63+2,1)); %x1: 4층 외피 a2=str2double(mm(35+2,1)); %x1: 8층 외피 a3=str2double(mm(7+2,1)); %x1: 12층 외피 b0=-str2double(mm(85+2,1)); %x2: 1층 계단실문 b1=-str2double(mm(64+2,1)); %x2: 4층 계단실문 b2=-str2double(mm(36+2,1)); %x2: 8층 계단실문 b3=-str2double(mm(8+2,1)); %x2: 12층 계단실문 c0=str2double(mm(87+2,1)); %x3: ev문, 1층 c1=str2double(mm(67+2,1)); %x3: ev문, 4층 c2=str2double(mm(39+2,1)); %x3: ev문, 8층 c3=str2double(mm(11+2,1)); %x3: ev문, 12층 fclose(output); m=[30 46 38 29 21 19 11 8 -4 -28 -49 27] s=[a0 a1 a2 a3 b0 b1 b2 b3 c0 c1 c2 c3] f=(m-s)*(m-s)' xx=[x(1) x(2) x(3)] fprintf('%10.9f %10.9f %10.9f',xx)

that's all. please help. me

matlab

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -