Color coding commented statements and comments following a statement

조회 수: 68 (최근 30일)
PChoppala
PChoppala 2015년 11월 18일
답변: mohand alzuhiri 2022년 10월 25일
Hi,
I would like to know if there is a possibility of having a different color for a commented statement and a comment that follows a statement, e.g.,
% u=rand
u = rand % generate a random number from U[0,1]
shows both in green but I would like to differentiate. I could not find a lead from MATLAB preferences.
  댓글 수: 9
olshie
olshie 2022년 2월 28일
It would be great to differentiate comment colors with flags: for example
%todo: do this later
would appear in a different color.
Gionata Quadri
Gionata Quadri 2022년 5월 13일
A small workaround could be to write the "comments" (e.g. todo) as a system command with the bash colon operator ':', and temporarily change their color in the settings.
s = settings;
s.matlab.colors.SystemCommandColor.TemporaryValue = [255 75 0];
!: TODO: Lorem ipsum
Unfortunately it only works on new lines.

댓글을 달려면 로그인하십시오.

답변 (5개)

Michal Demjan
Michal Demjan 2019년 8월 21일
Also interested!
Maybe just implement different commenting function starting with '%!' or something..

mbvoyager
mbvoyager 2018년 8월 24일
I'm also interested in this feature!

Francesco Guaresi
Francesco Guaresi 2018년 12월 4일
Hi guys! I'm interested too!!

Eli
Eli 2022년 7월 7일
I would also like more customizability for organizing code (like changing colors of comments)!

mohand alzuhiri
mohand alzuhiri 2022년 10월 25일
It would be nice to have a special color for ToDo items...This feature would be useful especially when you want to share them with your team

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by