Skip to content

Instantly share code, notes, and snippets.

@mattgaidica
Created December 28, 2018 16:09
Show Gist options
  • Save mattgaidica/63c2aff79748d841923e57ccede6d870 to your computer and use it in GitHub Desktop.
Save mattgaidica/63c2aff79748d841923e57ccede6d870 to your computer and use it in GitHub Desktop.
output a variable's size using >> sz
% 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