Hash :
a1747745
Author :
Date :
2014-12-22T22:15:56
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
<h1>MATLAB</h1>
<p>To use this language, use the class "language-matlab".</p>
<h2>Strings</h2>
<pre><code>myString = 'Hello, world';
otherString = 'You''re right';</code></pre>
<h2>Comments</h2>
<pre><code>% Single line comment
%{ Multi-line
comment }%</code></pre>
<h2>Numbers</h2>
<pre><code>x = 325.499
realmax + .0001e+308
e = 1 - 3*(4/3 - 1)
b = 1e-16 + 1 - 1e-16;
x = 2 + 3i;
z =
4.7842 -1.0921i 0.8648 -1.5931i 1.2616 -2.2753i
2.6130 -0.0941i 4.8987 -2.3898i 4.3787 -3.7538i
4.4007 -7.1512i 1.3572 -5.2915i 3.6865 -0.5182i
</code></pre>
<h2>Control flow</h2>
<pre><code>if rem(a, 2) == 0
disp('a is even')
b = a/2;
end
switch dayString
case 'Monday'
disp('Start of the work week')
case 'Tuesday'
disp('Day 2')
case 'Wednesday'
disp('Day 3')
case 'Thursday'
disp('Day 4')
case 'Friday'
disp('Last day of the work week')
otherwise
disp('Weekend!')
end
n = 1;
nFactorial = 1;
while nFactorial < 1e100
n = n + 1;
nFactorial = nFactorial * n;
end</code></pre>
<h2>Functions</h2>
<pre><code>q = integral(sqr,0,1);
y = parabola(x)
mygrid = @(x,y) ndgrid((-x:x/c:x),(-y:y/c:y));
[x,y] = mygrid(pi,2*pi);</code></pre>
<h2>Known failures</h2>
<p>There are certain edge cases where Prism will fail.
There are always such cases in every regex-based syntax highlighter.
However, Prism dares to be open and honest about them.
If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug.
</p>
<h3>String inside comment</h3>
<pre><code>%{ 'test' }%
% 'test'</code></pre>