As per my knowledge there is no as such function in MATLAB which can do constrained K-means clustering. In standard K-means, clustering is based upon only distances. You may have to build your own code for adding any constraints.
May be a good start would be if you:
- Assigned population to clusters.
- Then compute centroids of clusters.
- Assign points to centroids such that sum of population in that is in between 300-350.