Undefined function 'sdpvar' for input arguments of type 'double'.

1,613 views
Skip to first unread message

Ihsan Yanikoglu

unread,
Jan 14, 2015, 11:37:27 AM1/14/15
to yal...@googlegroups.com
I have copied the folder that contains all my codes (also Yalmip folder) from one laptop to another. After adding paths and etc. when I try to run the code, I got the following

run('C:\Program Files\yalmip\Facility Location Problems\BilevelVersion.m')
Undefined function 'sdpvar' for input arguments of type 'double'.

Error in BilevelVersion (line 24)

The Code is as simple as the following

" yalmip('clear')

n = 10; % number of customers
m = 11; % number of facility location candidates
P = 5;  % number of locations to be opened

% !!! Becareful first element is zeta_1 that is 1 !!!
mu =   [1; 10; 15; 23; 25; 25; 30; 28; 25; 10; 15]; % Analytic Center
v  = 1*[0; 3; 4; 7; 4; 8; 6; 9; 4; 4; 2]; % symmetric variation from AC

Cov=diag(v.^2/3)+mu*mu'; % Covariance matrix of the uncertain parameter

Ca = [100; 100; 100; 100; 100; 100; 100; 100; 100; 100; 100]; % Capacities of facilities
q = 100*ones(m,1);

cons=1; alpha=0.5; theta=0;

% Parameters of uncertainty set |zeta: W zeta >= h|
W = [eye(n+1); -1*eye(n+1)];
h = [mu-v; -1*(mu+v)];

M = sum(mu+v); % a sufficient big-M-value for integrality constraint

y = sdpvar(n,m,2,' full' ); % decision rule for flows"

i.e., it cannot define y as sdpvar. I know it has something to do with Add Path, but I have no idea. I use the same steps as I did in my other laptop. If I define this sdpvar at MATLAB command window, then it works (e.g., y = sdpvar(n,m,2, 'full')). My codes' folder is a subfolder of Yalmip's folder like in the other computer (I have also Add this folder to path).x

yalmiptest.m and all other stuff work fine, but for my codes it is not the case.

y = sdpvar(n,m,2); % decision rule for flows"




Johan Löfberg

unread,
Jan 14, 2015, 11:39:58 AM1/14/15
to yal...@googlegroups.com
Putting your code in a sub-folder of YALMIP sounds like a bad idea.

Clearly, your setup is messed up somehow. Make a clean install, and then addpath(genpath('yalmipdirectory')) and it should work
Reply all
Reply to author
Forward
0 new messages