Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Undefined function 'ndsdpvar' for input arguments of type 'double'.

Subject: Undefined function 'ndsdpvar' for input arguments of type 'double'.

From: Lei

Date: 24 Feb, 2013 15:10:09

Message: 1 of 3

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!

Subject: Undefined function 'ndsdpvar' for input arguments of type 'double'.

From: Johan Lofberg

Date: 25 Feb, 2013 08:59:16

Message: 2 of 3

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!

Subject: Undefined function 'ndsdpvar' for input arguments of type 'double'.

From: Lei

Date: 25 Feb, 2013 14:47:07

Message: 3 of 3

Thank you very much!

I find that I made a mistake. I should use "add with subfolder" instead of "add folder".

And thank you for the guide about coding. I just begin to learn matlab. I guess I have a long long way to go:P

"Johan Löfberg" wrote in message <kgf954$bab$1@newscl01ah.mathworks.com>...
> 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
>

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us