This is the error that appear:
Error using textscan
Invalid file identifier. Use fopen to generate a valid file identifier.
Error in diflecti (line 4)
C2 = textscan(fidInBDF,'%*s %*s %*s %s %*[^\n]'); % Scan second column of the bdf file
Error in barrier
Error in fmincon (line 796)
[X,FVAL,EXITFLAG,OUTPUT,LAMBDA,GRAD,HESSIAN] = barrier(funfcn,X,A,B,Aeq,Beq,l,u,confcn,options.HessFcn, ...
Error in main (line 25)
[x,y]=fmincon('weigh',x0,[],[],[],[],[],[],'diflecti')