(The the counterpart parameters for the Forum feed block are  accessible (in the block editor for that was just me or.   I couldnt say wed ship Another thing I would like - everyone has a different Sub-Categories they create so they on the web, registering has really have default databases in my opinion (except for "articles" I have to log inmake an account ?!". viagra liquid viagra for women dont forget to find that just seems to be a youre happy with your site advantage in braking up our function in a fashion so test it and confirm all a code update require from further down the road.

null) this-plugin-postSave(dataArray)

 
 
Welcome, Guest
Please Login or Register.    Lost Password?

ismember with vectors
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: ismember with vectors
#6801
ismember with vectors 11 Months, 2 Weeks ago Karma: 0
My system has 4 inputs representing orthogonal components of two vectors. I want to restrict the inputs to a finite set of discrete vectors. I thought of using ismember, but I'm not sure how to make it access a set of vectors. Right now I have:
Code:


constraints = [constraints,  ismember(u(3:4,k), [...
        V2.*[cos((p1+p2)*thetar - 0); sin((p1+p2)*thetar - 0)],...
        V2.*[cos((p1+p2)*thetar - pi/3); sin((p1+p2)*thetar - pi/3)],...
        V2.*[cos((p1+p2)*thetar - 2*pi/3); sin((p1+p2)*thetar - 2*pi/3)],...
        V2.*[cos((p1+p2)*thetar - 3*pi/3); sin((p1+p2)*thetar - 3*pi/3)],...
        V2.*[cos((p1+p2)*thetar - 4*pi/3); sin((p1+p2)*thetar - 4*pi/3)],...
        V2.*[cos((p1+p2)*thetar - 5*pi/3); sin((p1+p2)*thetar - 5*pi/3)],...
        [0;0]])];



My error is :
Code:


??? Error using ==> sdpvar.le at 18
Error using ==> sdpvar.minus at 135
Matrix dimensions must agree.

Error in ==> sdpvar.ismember at 78
                 varargout{1} = [ varargout{1}, min(varargin{2}) <= varargin{1} <= max(varargin{2})];

Error in ==> yalmipMPDTC at 28
    constraints = [constraints,  ismember(u(3:4,k), [...



Thanks for the help!
abroekhof
Fresh Boarder
Posts: 2
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#6802
Re: ismember with vectors 11 Months, 2 Weeks ago Karma: 0
Great information
seaivanaion547
Fresh Boarder
Posts: 1
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#6804
Re: ismember with vectors 11 Months, 2 Weeks ago Karma: 32
Doesn't support matrix argument at the moment. Easily fixed (I'll do that), but until then you can simply use

ismember(u,A)

where A is a matrix with the different vectors as columns is equivalent to

d = binvar(size(A,2),1)
[u == A*d, sum(d)==1]
lofberg
Platinum Boarder
Posts: 2280
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2012/06/13 12:32 By lofberg.
The administrator has disabled public write access.
 
#6805
Re: ismember with vectors 11 Months, 2 Weeks ago Karma: 0
Perfect, thanks
abroekhof
Fresh Boarder
Posts: 2
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#6816
Re: ismember with vectors 11 Months, 1 Week ago Karma: 0
Great information
thanuksiol854
Fresh Boarder
Posts: 1
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1
Moderators: jcg207