Programming with MATLAB

MATLAB is a high-level programming language designed for engineers and scientists that expresses matrix and array mathematics directly. You can use MATLAB for everything, from running simple interactive commands to developing large-scale applications.

Start Simple—No Programming Experience Required

Get started quickly by executing commands interactively with immediate results.
>> sqrt(42) ans = 6.4807
You can express matrix and array mathematics directly using familiar syntax.
>> A = [7 8 2; 3 2 6; 5 9 4] A = 7 8 2 3 2 6 5 9 4

MATLAB ® provides thousands of built-in functions for common mathematical, scientific, and engineering calculations.

>> B = eig(A) B = 14.9016 2.3000 -4.2015

You can choose from a variety of built-in plots to visualize your data. Specialized data types, including numeric, string, datetime, categorical, structures, and tables are available to represent your data. You can perform common tasks using functions that are specifically designed for each data type.

>> stars = readtable('StarTypes.xlsx',TextType = 'String'); >> stars.Class = categorical(stars.Class) stars = Class Temp Color Fraction _____ _____ _____________ ________ O 30000 "Blue" 3e-05 B 10000 "Blue White" 0.0013 A 7500 "White" 0.006 F 6000 "Yellow White" 0.03 G 5200 "Yellow" 0.076 K 3700 "Light Orange" 0.121 M 2400 "Orange Red" 0.7645

With MATLAB, you can develop algorithms much faster than in traditional languages, such as C, C++, or Fortran, without having to declare variables, allocate memory, or compile code.