Top 1,000 Features Creators Resources Extensions Blog Explorer CSV Download
GitHub icon


< >

MATLAB is a programming language created in 1984 by Cleve Moler.

#24on PLDB 40Years Old 312kRepos

MATLAB (matrix laboratory) is a multi-paradigm numerical computing environment. A proprietary programming language developed by MathWorks, MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other languages, including C, C++, C#, Java, Fortran and Python. Although MATLAB is intended primarily for numerical computing, an optional toolbox uses the MuPAD symbolic engine, allowing access to symbolic computing abilities. Read more on Wikipedia...

Example from hello-world:
disp('Hello World')
% Hello World in MATLAB. disp('Hello World');
Example from Linguist:
function [ d, d_mean, d_std ] = normalize( d ) d_mean = mean(d); d = d - repmat(d_mean, size(d,1), 1); d_std = std(d); d = d./ repmat(d_std, size(d,1), 1); end
Example from Wikipedia:
[X,Y] = meshgrid(-10:0.25:10,-10:0.25:10); f = sinc(sqrt((X/pi).^2+(Y/pi).^2)); surf(X,Y,f); axis([-10 10 -10 10 -0.3 1]) xlabel('{\bfx}') ylabel('{\bfy}') zlabel('{\bfsinc} ({\bfR})')

Language features

Feature Supported Token Example
Scientific Notation โœ“
Print() Debugging โœ“ disp
Line Comments โœ“ %
% A comment
Operator Overloading โœ“
Iterators โœ“
% Define an array of integers
myArray = [1,3,5,7,11,13];

for n = myArray
   % ... do something with n
   disp(n)  % Echo integer to Command Window
File Imports โœ“
import pkg.cls1
import pkg.pkfcn
Type Casting โœ“
b = cast(a, 'like', p)
Constructors โœ“
MultiLine Comments โœ“ %{ %}
A comment.
Comments โœ“
% This is a comment
Strings โœ“ '
"hello world"
Semantic Indentation X

View source

- Build the next great programming language ยท About ยท Acknowledgements ยท Published by Breck's Lab