MATLAB: .MAT variables to list box

.mat filelistbox

I am trying to list the contents of a .MAT file in a list box. to choose which one to import into a CSV file. I am currently using a uiget command that outputs the .MAT file as a string. How do I access the contents of the .MAT file and export them to a list box? I am using 2007b
Thank you.

Best Answer

This should get you started.
MatFile=uigetfile('*.mat');
MyVar=load(MatFile);
VarNames=fieldnames(MyVar);