%MATLABRC Master startup M-file.
%
%   MATLABRC is automatically executed by MATLAB during startup.
%   It establishes the MATLAB path, sets the default figure size,
%   and sets a few uicontrol defaults.
%
%   MATLABRC also invokes a STARTUP command if the file 'startup.m'
%   exists on the MATLAB path.

%   Copyright (c) 1984-93 by the MathWorks, Inc.

% Setup the MATLAB search path.

matlabpath([...
'D:\MATLAB;',...
'D:\MATLAB\toolbox\matlab\general;',...
'D:\MATLAB\toolbox\matlab\ops;',...
'D:\MATLAB\toolbox\matlab\lang;',...
'D:\MATLAB\toolbox\matlab\elmat;',...
'D:\MATLAB\toolbox\matlab\specmat;',...
'D:\MATLAB\toolbox\matlab\elfun;',...
'D:\MATLAB\toolbox\matlab\specfun;',...
'D:\MATLAB\toolbox\matlab\matfun;',...
'D:\MATLAB\toolbox\matlab\datafun;',...
'D:\MATLAB\toolbox\matlab\polyfun;',...
'D:\MATLAB\toolbox\matlab\funfun;',...
'D:\MATLAB\toolbox\matlab\sparfun;',...
'D:\MATLAB\toolbox\matlab\plotxy;',...
'D:\MATLAB\toolbox\matlab\plotxyz;',...
'D:\MATLAB\toolbox\matlab\graphics;',...
'D:\MATLAB\toolbox\matlab\color;',...
'D:\MATLAB\toolbox\matlab\sounds;',...
'D:\MATLAB\toolbox\matlab\strfun;',...
'D:\MATLAB\toolbox\matlab\iofun;',...
'D:\MATLAB\toolbox\matlab\demos',...
';D:\MATLAB\toolbox\robust',...
]);

% Set the default uicontrol color.

gray = [128/255 128/255 128/255];
set(0,'defaultuicontrolbackgroundcolor',gray);

% Set the default figure position, in pixels.
% On small screens, make figure smaller, with same aspect ratio.

screen = get(0, 'ScreenSize');
width = screen(3);
height = screen(4);
if height >= 500
   mwwidth = 560; mwheight = 420;
else
   mwwidth = 500; mwheight = 375;
end
left = (width-mwwidth)/2;
bottom = height-mwheight-60;
rect = [ left bottom mwwidth mwheight ];
set(0, 'defaultfigureposition',rect);

% Clean up work space.

clear gray screen width height mwwidth mwheight left bottom rect
flops(0);

% Display helpful hints.

disp(' ')
disp('Commands to get started: intro, demo, help help')
disp('Commands for more information: help, whatsnew, info, subscribe')
disp(' ')

% Now execute startup M-file, if it exists.

if (exist('startup.m')==2)
    startup
end
