The following syntax will read data for LP and MILP problems from the MPS file 'file.mps' and return the data in a structure. One of the fields of the structure is 'variableNames', which is a string array containing variable names from the MPS file.
problem = mpsread('file.mps','ReturnNames',true)
For an example on the usage of the 'mpsread' function, refer to this link : mpsread
Hope this helps!