From this question I understand that syntax highlighting on Stack Overflow is done using Google's prettify project, which does support MATLAB syntax.
Despite this, the MATLAB information page still specifies Code Language (used for syntax highlighting): default
at the bottom.
Even if I use <!-- language: lang-matlab -->
before a code block, the syntax highlighting doesn't work correctly.
For the most part, this isn't that big a deal, but the MATLAB matrix transpose operator is '
, which makes the code highlighter think that everything between a pair of '
characters is a string. This can really make code hard to read.
a = 1:5;
b = a';
C = a*b;
for i = 1:5
for j = 1:5
R(i,j) = rand();
end
end
d = det(C'*R);
Can we get MATLAB syntax highlighting?
%//
since%
isn't recognized as the start of a comment.C
! It looks gorgeous!