help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Error messages


From: salehh
Subject: Error messages
Date: Tue, 3 Oct 1995 11:03:46 -0700 (PDT)

I can't make sense of the following error messages I am getting from
octave. All of "lb1, lb2, ub1, ub2, x0" are 7 x 1 column vectors
and a is a 7 x 7 square matrix.

octave:1> test2

error: invalid conversion from real matrix to string
error: npsol: bounds for linear constraints must be vectors
error: evaluating index expression near line 24, column 27
error: evaluating assignment expression near line 24, column 25
octave:2> who

*** currently compiled functions:

phi

*** local user variables:

a    lb1  lb2  ub1  ub2  x0

=======================================================================
test2.m:

#c = [-.02 -.2 -.2 -.2 -.2 .04 .04]';
#h = 2*eye(7); h(3,4)=2;h(4,3)=2;h(6,7)=-2;h(7,6)=-2;h(6,6)=-2;h(7,7)=-2;
a = [ 1.0  1.0  1.0  1.0  1.0  1.0  1.0
      .15  .04  .02  .04  .02  .01  .03
      .03  .05  .08  .02  .06  .01  .00
      .02  .04  .01  .02  .02  .00  .00
      .02  .03  .00  .00  .01  .00  .00
      .70  .75  .80  .75  .80  .97  .00
      .02  .06  .08  .12  .02  .01  .97 ];

lb1 = [-.01 -.1 -.01 -.04 -.1 -.01 -.01]';
ub1 = [ .01  .15 .03  .02  .05 inf inf ]';
lb2 = [-.13 -inf -inf -inf -inf -.099 -.003]';
ub2 = [-.13 -.0049 -.0064 -.0037 -.0012 inf .002]';
x0 = [-.01 -.03 0.0 -.01 -.1 .02 .01]';

[X2,OBJ2,INFO2,LAMBDA2] = npsol(x0,'phi',lb1,ub1,lb2,a,ub2)

=======================================================================
phi.m:

function y = phi(x)
c = [-.02 -.2 -.2 -.2 -.2 .04 .04]';
h = 2*eye(7); h(3,4)=2;h(4,3)=2;h(6,7)=-2;h(7,6)=-2;h(6,6)=-2;h(7,7)=-2;
y = c'*x + 0.5*x'*h*x;
endfunction

=====================================================================

H. I. SALEH



reply via email to

[Prev in Thread] Current Thread [Next in Thread]