function calendarTest
% This function proofes that there is a Matlab Bug if you name a variable 
% the same like a function. It's not treaten the same in every case.
% Sometimes the variable is dominant, sometimes the function. You can set a
% breakpoint on line 31 and watch the variable calendar in the Workspace,
% which is the value of myDate. But have a look what appears in the command
% window if you go ahead.
%
% I use MATLAB Version 7.6.0.324 (R2008a)
%
% S.Schmutz, 15.9.2008
% -------------------------------------------------------------------------

% Create variables
myDate = 'Sat Aug 23 12:15:15 2008';
myMachine = '24h_new machine';
% Display this variable in a function and name it "calendar"
displayCalendar(myDate)
% Define the new variables out of the structure with eval
eval(['calendar = ''',myDate,''';'])
eval(['recfile = ''',myMachine,''';'])
% Display the values
display('******************************************************')
display('The variable ''recfile'' is displayed right')
display('******************************************************')
display(recfile)
display('******************************************************')
display('The variable ''calendar'' is displayed wrong, the')
    display('function calendar is dominant')
display('******************************************************')
display(calendar)
display('******************************************************')
display('The variable ''calendar'' is displayed right, if')
    display('you display it with the command ''eval''')
display('******************************************************')
eval('display(calendar)')

% -------------------------------------------------------------------------
function displayCalendar(calendar)
% Display the variable calendar, what is no problem

display('******************************************************')
display('Here, the variable ''calendar'' is dominant')
display('******************************************************')
display(calendar)