%% Retrieve Memory Information
% Retrieve information about your computer memory and display the information in the Command Window.

memory

% Return the user-focused memory information in a structure user. Use the structure to display the amount of memory reserved for the MATLAB process.

user = memory;
disp(user.MemUsedMATLAB)

% Return both the user-focused and system-focused memory information.

[user,sys] = memory

% Access the Available field of the PhysicalMemory structure to display the amount of available physical memory on the computer.

disp(sys.PhysicalMemory.Available)

% Copyright 2020 The MathWorks, Inc.