Printing Size of Variable from Clipboard in MATLAB
The single most used command for me while debugging is size(varName)
. After the variables pile up in the workspace, the workspace viewer is not a great source of information. Ideally, the workspace viewer could be a bit more dynamic having a sort column for “last used” with some abstract information about where the variable was last called from, akin to some of the profiler features.
This snippet, when saved as “sz.m”, will find a variable a workspace variable based on the current clipboard value and output the size from simply typing: sz
. This essentially replaces, size(⌘V)
. Because it needs access to the working environment, it cleans up all the variables used to accomplish this task at the end (i.e., graceful).
Recent Comments
Archives
- April 2023
- January 2023
- November 2022
- May 2022
- March 2022
- January 2022
- December 2021
- April 2021
- December 2020
- October 2020
- August 2020
- July 2020
- March 2020
- February 2020
- January 2020
- December 2019
- November 2019
- October 2019
- January 2019
- December 2018
- November 2018
- August 2018
- July 2018
- April 2018
- March 2018
- November 2017
- October 2017
- February 2017
- October 2016
- August 2016
- July 2016
- November 2015
- October 2013
- February 2013
- January 2013
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- February 2012
- December 2011