Created
February 10, 2015 16:44
-
-
Save wouterpotters/c9b4c1cf07acc3bcae4f to your computer and use it in GitHub Desktop.
Matlab memory function for Mac OS X
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ismac % if computer is a mac. | |
[~,txt] = system('sysctl -a | grep hw.memsize | awk ''{print $2}'''); % get physical system memory | |
memory_avail_in_gb = (eval(txt)/1024^3); % convert from byte to Gb. | |
fprintf(['Available memory: ' num2str(memory_avail_in_gb) ' Gb']) % display amount of memory available | |
else % on pc's | |
memory % use builtin memory function | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment