Dear Hossein,
thanks for your response. The idea is the following. I generate the coordinates and the adjacency matrix of some nodes, and I want to plot the resulting graph in MATLAB (using gplot?). And I want to make this automatic from GAMS, as I have many graphs to generate and plot.
Here you have a code to generate such data in GAMS:
set i nodos /1*6/;
alias(i,j);
parameter edge(i,j) adjacency matrix;
edge(i,j) = 0;
parameter horizontal(i) horizontal coordinates;
horizontal(‘1’) = 0;
horizontal(‘2’) = 1;
horizontal(‘3’) = 1;
horizontal(‘4’) = 2;
horizontal(‘5’) = 2;
horizontal(‘6’) = 3;
parameter vertical(i) vertical coordinates;
vertical(‘1’) = 1;
vertical(‘2’) = 2;
vertical(‘3’) = 0;
vertical(‘4’) = 2;
vertical(‘5’) = 0;
vertical(‘6’) = 1;
*define the edges
edge(‘1’,‘2’) = 1;
edge(‘1’,‘3’) = 1;
edge(‘2’,‘3’) = 1;
edge(‘2’,‘4’) = 1;
edge(‘2’,‘5’) = 1;
edge(‘3’,‘5’) = 1;
edge(‘4’,‘5’) = 1;
edge(‘4’,‘6’) = 1;
edge(‘5’,‘6’) = 1;
edge(i,j)$(ord(i) > ord(j) and edge(j,i) = 1)=1;
Thank you!
Fede
On Wed, Apr 22, 2015 at 1:08 PM, Hossein Sharifzadeh wrote:
Dear Federico
I have some skills in MATLAB. I do not know where is your problems.
If you send me your data and explicitly determines what you intend to plot, I can write your
required code and plot associated figures.
Best regards;
Hossein
On Tue, Apr 21, 2015 at 5:35 PM, Federico Perea wrote:
Hi everyone,
I have the coordinates of the nodes, and the adjacency matrix (both created in gams), and now I want to plot the resulting graph using matlab (or any other possibility you may think of). Do you have an example of how to do this? Although I have found plenty of documentation, I haven’t been able to do it.
Thanks in advance
Federico Perea
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.