List or Edit Recently Modified Files in MATLAB
Git is a good way to keep track of file changes and integrates with MATLAB but doesn’t quickly tell you what files you have been working on. The MATLAB editor has persistence after closing (so that files will re-open in tabs) and Open > RECENT FILES
is good to see where you left off. If you ever mistakenly close all tabs, MATLAB actually keeps record of your workspace and you can recover it. However, if want to hop back into a file from days ago or work across machines, the workflow is subpar.
workon.m will list the n most recently edited files in the current directory (recursively) and then let you open one, or many of those files for editing.
>> workon 15 MOST RECENT FILES -------------------- [01] --> entrainment_HighResolution.m (now) [02] --> workon.m (now) [03] --> Ray_LFPspikeCorr.m (3 hours ago) [04] --> wholeSessionPowerCorr.m (18 hours ago) [05] --> deltaPhaseSpiking_wBeta.m (5 days ago) [06] --> deltaPhaseBetaEvents.m (6 days ago) [07] --> run_code.m (6 days ago) [08] --> entrainmentTrialShuffle.m (6 days ago) [09] --> dklPeakDetect.m (7 days ago) [10] --> deltaRTchaos_simpleCorr.m (8 days ago) [11] --> Leventhal2012_Fig6_spikePhaseHist_allFreqs.m (15 days ago) [12] --> ff.m (15 days ago) [13] --> periEventTrialTs.m (15 days ago) [14] --> eventsLFPv2.m (15 days ago) [15] --> spectrum_MRL.m (18 days ago)
Next, you can open any number of those files by passing in a single integer (for one file) or an integer vector of all the files you want to open. For instance, to open the 7 most recently edited files in the MATLAB editor:
>> workon(1:7)
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