[AMPL 25040] Matrix of variables

Hello everyone,
I have 4 variables like this:
var p0;
var b;
var x;
var y;

And I want to create a matrix of these variables with dimensions (4*1) like so:
var X = [p0, b, x, y]
Could anyone please provide me with the syntax for this matrix? Furthermore, I would like to express the following constraint:
A * X < B .
Where A and B are matrixes of values that I have defined previously. Thank you.

Your question has been moved to our new user forum at discuss.ampl.com, and a response has been posted there. To see the response, use this link:


To reply, click the red “Reply” button that follows the response. (Do not send an email reply to this message.)