Category Archives: MATLAB

Display codes from different computing languages on WordPress

I came across a post on how to display codes from different languages on WordPress.

Basically, WordPress utilises a feature to turn a piece of, say MATLAB, code from this:

t = 0:dt:10;                       % Time vector
a = 2*sin(2*pi*2*t);            
plot(t,a,'k')			
xlabel('Time [s]')		
ylabel('Signal [-]')

to this:

t = 0:dt:10;                    % Time vector
a = 2*sin(2*pi*2*t);
plot(t,a,'k')
xlabel('Time [s]')
ylabel('Signal [-]')

Putting this way, the syntax will be highlighted, along with the row number.

Advertisements