function workspace(arg)
%WORKSPACE View the contents of a workspace.
%   WORKSPACE Opens the Workspace browser with a view of the variables
%   in the current Workspace.  Displayed variables may be viewed,
%   manipulated, saved, and cleared.
%
%   See also WHOS, OPENVAR, SAVE.

%   Copyright 1984-2000 The MathWorks, Inc. 
%   $Revision: 1.36 $

% Check for required level of Java support
err = javachk('mwt', 'The Workspace browser');
if (~isempty(err))
    error(err);
end

%Launch the Workspace
if nargin == 0
    try
        com.mathworks.ide.workspace.WorkspaceBrowser.getWorkspaceBrowser;
    catch
        error('Failed to open Workspace browser');
    end
else
    if strcmp(arg,'-refresh')
        % force workspace browser to refresh
        com.mathworks.ide.workspace.WorkspaceBrowser.refreshListing
    end
end
        
