Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can we change the font color of Functions and variables in Matlab editor

Tags:

matlab

Currently in MatLab 2012a the color of user variables e.g. rhoc, qin, qout etc. and reserved Functions e.g. imagesc, Figure, xlabel, caxis etc. IS the same i.e. BLACK, would be nice if I can change it - I am a new learner and it would be SO nice if I can differentiate them. Please help - perhaps this is easy for you. Please answer ASAP. Thanks in advance.

like image 940
bennyhardjono Avatar asked Nov 02 '22 11:11

bennyhardjono


2 Answers

Such a syntax highlighting is impossible. You could names variables identical to a build in function. Simple example:

eval(char([105   109    97   103   101   115    99   114    61    49    50]))
imagescr

In this case, execution of the code is necessary to realise that imagescr is "12".

like image 133
Daniel Avatar answered Nov 15 '22 10:11

Daniel


To elaborate on my comment above - I use Sublime Text 2 as my code editor, which looks a bit like this.

Notice that all Matlab keywords (for, if and end) and built-in functions (fprintf, datestr) are highlighted in red. Strings are in yellow, and numeric literals and format specifiers within strings are in purple.

User-defined variables (businessDate, t, T, binnedData) appear in white and comments are in gray.

enter image description here

like image 41
Chris Taylor Avatar answered Nov 15 '22 08:11

Chris Taylor