I suggest you to not use a function to keep things simpler and keep all the variables in your base workspace.
Here is an example for one list box:
mass = [ 23 45 44];
velocity = [34 53 32];
time = [1 2 3];
acceleration = [32 22 12];
speed = [12 33 44];
figure;
yourcell = {'mass','velocity','time','acceleration','speed'};
hb = uicontrol('Style', 'listbox','Position',[100 100 200 200],...
'string',yourcell,'Callback',...
['switch get(hb, ''Value''), ',...
'case 1, mass, ',...
'case 2, velocity, ',...
'case 3, time, ',...
'case 4, acceleration, ',...
'case 5, speed, ',...
'end']);
However this displays in command window, you could change the code to show it in a text box in your gui.
You can also execute a script as the Callback function.
hb = uicontrol('Style', 'listbox','Position',[100 100 200 200],...
'string',yourcell,'Callback', 'myScript');
and then create an m-script in your directory: (myScript.m)
switch get(hb, 'Value')
case 1
mass
case 2
velocity
case 3
time
case 4
acceleration
case 5
speed
end
Note that everything is still in your base workspace.
Hope it helps.