Are you really using a recent version of YALMIP with a correctly setup path? I cannot reproduce this error. In case the errors remain after you install the most recent version of YALMIP and set your path (include all subdirectories in YALMIP), mail me for further assistance (johanl@isy.liu.se)
BTW, the coding style you use is obsolete. The operator SET should no longer be used in YALMIP. Your code should/can be written as
F= [x>=0];
for i=1:4
for c=1:6
F=[F, sum(x(i,1,c,:))==Plant_1{i,c}]);
end
end
"Lei " <aiou@sjtu.edu.cn> wrote in message <kgdagh$1dv$1@newscl01ah.mathworks.com>...
> hi
>
> i use yalmip and code as follow:
>
> [Plant_1_N,Plant_1_T,Plant_1]=xlsread('F:\Second_Stage_Trail.xlsx','Sheet1');
> [Plant_2_N,Plant_2_T,Plant_2]=xlsread('F:\Second_Stage_Trail.xlsx','Sheet2');
> [Book_Capacity_N,Book_Capacity_T,Book_Capacity]=xlsread('F:\SGM\Second_Stage_Trail.xlsx','Sheet3');
>
> % [Plant_1_N,Plant_1_T,Plant_1]=xlsread('F:\Second_Stage_Trail.xlsx','Sheet4');
> % [Plant_2_N,Plant_2_T,Plant_2]=xlsread('F:\Second_Stage_Trail.xlsx','Sheet5');
>
> x = sdpvar(4,2,6,31,'full');
>
> F=set(x>=0);
>
> for i=1:4
> for c=1:6
> F=F+set(sum(x(i,1,c,:))==Plant_1{i,c});
> end
> end
>
> for i=1:4
> for c=1:6
> F=F+set(sum(x(i,2,c,:))==Plant_2{i,c});
> end
> end
>
> for j=1:2
> for d=1:31
> F=F+set(sum(sum(x(:,j,:,d)))<=Book_Capacity{d,j});
> end
> end
>
> f=0;
>
> solvesdp(F,f);
>
>
> but when i running it it give me a msg :
>
> >> Second_Stage_Trail
> Undefined function 'ndsdpvar' for input arguments of type 'double'.
>
> Error in sdpvar (line 127)
> sys = ndsdpvar(varargin{:});
>
> Error in Second_Stage_Trail (line 8)
> x = sdpvar(4,2,6,31,'full');
>
> then i ask my friend to run this for me, he did not have the error though he could not get a solution.
>
> i do not know where is wrong.
>
> but when i try to use cplex to solve the problem, i can get a solution.
>
> thanks a lot for help!
