code snippet in jekyll in matlab

To add a code snippet of Matlab language in Jekyll, you can use the Liquid templating engine to format your code block. You can use the following syntax for code snippets:

main.m
{% highlight matlab %}
% Your Matlab code here
{% endhighlight %}
66 chars
4 lines

For example, if you want to display a simple Matlab code that adds two numbers, you can use the following code snippet:

main.m
{% highlight matlab %}
a = 5;
b = 10;
c = a + b;
disp(c);
{% endhighlight %}
77 chars
7 lines

This will display the following code block on your Jekyll site:

main.m
a = 5;
b = 10;
c = a + b;
disp(c);
35 chars
5 lines

You can customize the syntax highlighting by specifying the linenos and hl_lines parameters in the highlight tag. For more information, you can refer to the Jekyll documentation.

related categories

gistlibby LogSnag