Drexel dragonThe Math ForumDonate to the Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: In need of some help of the usage of tomlab
Replies: 1   Last Post: Aug 8, 2009 1:11 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 6
Registered: 7/23/09
In need of some help of the usage of tomlab
Posted: Jul 25, 2009 4:59 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hello all,
I'm currently trying to establishing a timetable and i'm doing it with tomlab, as they have a similiar case
see: tomsym.com/examples/tomsym_collegetimetable.html

As i'm a green hand to matlab. I first tried to simplify my program and try to do a program similiar to the example given.

The timetable in my program: there are 3 teachers, 5 courses(each lesson has 2,2,3,2,2 lessons per week respectively),these teachers can teach any of these 5 courses.there are 5 workdays a week and each day has 4 slots.
Objective1:The desirable time for students to have courses are the 2nd and 3rd slots each day. so we have to minimize the courses' appearing on the 1st and 4th slots each day.
Objective2:The desirable schedule in the part of the 3 teachers are to teach only 2,2,3 courses per week respectively.This can't be satisfied,due to the prescribed courses per week is 2+2+3+2+2,and it's larger than 2+2+3.but we can minimize 'overwork' time.

My program using tomlab:
teacher=[1 2 3];
lesson=[1 2 3 4 5];
lesson_times=[2 2 3 2 2];
teach=tomArray('teach',[3,5,20]); %create a array of 3*5*20 (teacher*lesson*slots)

bnds1={0<=teach<=1}; % All variables are binary

%the prescribed lessons must be satisfied

% Teacher constraint, one teacher per slot


%the goal is to minimize teaching courses in these no so good slots

max_work=[2 2 3];
for i=1:3
if overwork>0

However, when i typed in


it says:Error in ==> tomArray.subsref at 78

And when i typed in

for i=1:3
if overwork>0

it says:??? Function 'gt' is not defined for values of class 'tomArray'.

Error in ==> gt at 18
[varargout{1:nargout}] = builtin('gt', varargin{:});

I have checked my program several times and could not find out what is wrong, can anybody give me suggestions , or some relative material to help me understand?
Thanks a lot!

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum 1994-2015. All Rights Reserved.