Search found 21 matches

by Bahar_Mdi
1 week ago
Forum: Syntax
Topic: index of elements in GAMS
Replies: 4
Views: 243

Re: index of elements in GAMS

Thanks a lot.
by Bahar_Mdi
1 week ago
Forum: Syntax
Topic: index of elements in GAMS
Replies: 4
Views: 243

Re: index of elements in GAMS

Thans for your response. But I can not do your approach because the order of elements in the set may change during each iteration of my algorithm.
by Bahar_Mdi
1 month ago
Forum: Syntax
Topic: index of elements in GAMS
Replies: 4
Views: 243

index of elements in GAMS

Hi, I have a set in MATLAB that I want to export it to GAMS and the order of elements in the set is important to me. As I know, the order that I define the set for the first time is the order that is defined for GAMS. As an example, I have the below code in MATLAB: Is.name='i'; Is.type='set'; Is.val...
by Bahar_Mdi
1 month ago
Forum: Syntax
Topic: Refer to Special element of a set
Replies: 2
Views: 216

Re: Refer to Special element of a set

Thanks for your help.
by Bahar_Mdi
1 month ago
Forum: Syntax
Topic: Refer to Special element of a set
Replies: 2
Views: 216

Refer to Special element of a set

Hi,
Consider I have defined set i as /5,7,8,3,2,9/ in Gams and I want to define sub(i) such that contains the first element of i and define sub2(i) such that includes the last element of i. How shoud I do that?
It is notable that the set i is imported to Gams and I don't know its element in advance.
by Bahar_Mdi
1 month ago
Forum: API
Topic: Exporting data from MATLAB to GAMS
Replies: 5
Views: 297

Re: Exporting data from MATLAB to GAMS

Thanks for your reply. This is my code in MATLAB: ----------------------- Ps.name='p'; Ps.type='set'; Ps.val=[1:84]'; Ps.dim=1; Is.name='i'; Is.type='set'; Is.val=[1;9;6;15]; Is.dim=1; P8s.name='zb'; P8s.type='parameter'; P8s.form='full'; P8s.val=[0 1 0 0;0 0 1 0;0 0 0 1;0 0 0 0]; P8s.dim=2; wgdx('d...
by Bahar_Mdi
1 month ago
Forum: API
Topic: Exporting data from MATLAB to GAMS
Replies: 5
Views: 297

Re: Exporting data from MATLAB to GAMS

Thanks for your respone.
How should I use the second approach?
When I add the set order(i<), I get errors 10,185,492,649.
by Bahar_Mdi
1 month ago
Forum: API
Topic: Exporting data from MATLAB to GAMS
Replies: 5
Views: 297

Exporting data from MATLAB to GAMS

Dear all, I am trying to import data from MATLAB to GAMS. the sets and parameters result from a heuristic algorithm that I can not manipulate the values. Consider I have a set i as follows /10,5,2,9/. I need to define this set and some parameters on this set. bet the parameters which are defined on ...
by Bahar_Mdi
2 months ago
Forum: API
Topic: Linking GAMS and Matlab
Replies: 0
Views: 680

Linking GAMS and Matlab

Dear all, I'm trying to call a gams model from Matlab, but every time it executes the GAMS command, I get the " gdxxrw.exe has stopped working" error. The model reads the data from excel files and I run the model within the gams IDE just fine! But when I remove the following codes which are related ...
by Bahar_Mdi
2 months ago
Forum: API
Topic: Exporting data from MATLAB to GAMS
Replies: 1
Views: 254

Exporting data from MATLAB to GAMS

Dear all, I am trying to export a set and a parameter from MATLAB to GAMS. As an example, Consider the set is i = [2;5;1;6] and the parameter x(i) is [10 -6 3 -5] in MATLAB. my problem is that the parameter isn't exported correctly to GAMS. I try the below code in MATLAB: >>Is.name='i'; Is.type='set...