Add a comment signature to a script with a shortcut.

조회 수: 2 (최근 30일)
Kris Hoffman
Kris Hoffman 2020년 6월 5일
So, this might be an odd question, but I'd like to know if there's a way to add a comment line to an open script in matlab via keyboard shortcut or quick access toolbar button. There are a few people that work on one script and it's hard to tell who changed what. So to make it easier, it would be nice to have a way to quickly do this...
Original code:
function MarkerLabels(app)
if isempty(app.EventMarkers) % This will only apply if you browse for the same file.
cla(app.UIAxes2)
% If there are no markers, then clear the marker axes and
% reset the interface if there's no events stored in
% app.EventMarkers
app.PreviousMarkerButton.Enable = 'off';
app.NextMarkerButton.Enable = 'off';
...
Then press a key combo or toolbar button and apply a "signature" to the comment or line of code. Like this...
function MarkerLabels(app)
if isempty(app.EventMarkers) % This will only apply if you browse for the same file.
cla(app.UIAxes2)
% If there are no markers, then clear the marker axes and
% reset the interface if there's no events stored in
% app.EventMarkers % Added by KH June-05-2020 15:45CST (Friday)
app.PreviousMarkerButton.Enable = 'off';
app.NextMarkerButton.Enable = 'off';
...
I know how to make a quick access button to run code on the command line, but I want to place a signature in an open script file using something like
datetime
with some additional formatting.
Thanks

답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Objects에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by