MATLAB: Solve system of equations and inequalities with multiple solutions

MATLABsolve

How to solve a system of equations and inequalities with many solutions? I have the following set of equations:
a + b + c = 4 ;
9 <= a + 2b + 3c <= 12;
c >= 2;
b+c >= 3 ;
a >=0;
and get all the following solutions (a,b,c)=(1,1,2) or (0,2,2) or (1,0,3) or (0,1,3) or (0,0,4).
I have tried solving with vpasolve but it gives me "Empty sym: 0-by-1"
syms m1 m2 m3
S = vpasolve([m1 + m2 + m3 == 4, 9 <= m1+ 2* m2+ 3* m3, m1+ 2* m2+ 3* m3 <= 12, m3 >=2, m3+m2 >=3], [m1,m2,m3])

Best Answer

[M1, M2, M3] = ndgrid(0:4);
m1 = M1(:); m2 = M2(:); m3 = M3(:);
solidx = find(all([m1 + m2 + m3 == 4, 9 <= m1+ 2* m2+ 3* m3, m1+ 2* m2+ 3* m3 <= 12, m3 >=2, m3+m2 >=3], 2));
[m1(solidx), m2(solidx), m3(solidx)]