-
-
Save mattgaidica/63c2aff79748d841923e57ccede6d870 to your computer and use it in GitHub Desktop.
output a variable's size using >> sz
This file contains hidden or 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
% output a variable's size using >> sz | |
w = whos; | |
findvar = clipboard('paste'); | |
ii = strcmp({w.name},findvar); | |
if any(ii) | |
w(ii).size | |
else | |
disp(sprintf("\nNo variable '%s'\n",findvar)); | |
end | |
clearvars('-except',w(:).name); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment