MATLAB Fundamentals
MATLAB Fundamentals
Use square brackets and separate the values using a = [10 15 20 25]
a comma or a space.
a =
10 15 20 25
Transpose a Vector
c =
2 3 5 7
Create a Matrix
When Interval is 1
https://matlabacademy.mathworks.com/R2022a/portal.html?course=mlbe#chapter=3&lesson=4§ion=1 1/4
10/3/22, 9:45 AM MATLAB Fundamentals
Given the Start Value, End Value, and Number of Elements
Concatenating Arrays
Horizontal Concatenation
Vertical Concatenation
Separate elements
using a semicolon (;)
Combined Concatenation
https://matlabacademy.mathworks.com/R2022a/portal.html?course=mlbe#chapter=3&lesson=4§ion=1 2/4
10/3/22, 9:45 AM MATLAB Fundamentals
Calling Output
syntax
fun(m,n)
m-b y-n
fun(n)
n-b y-n
Reshaping Arrays
x = rand(260,1);
https://matlabacademy.mathworks.com/R2022a/portal.html?course=mlbe#chapter=3&lesson=4§ion=1 3/4
10/3/22, 9:45 AM MATLAB Fundamentals
y = reshape(x,5,52);
Specify the dimensions for the new array.
y = reshape(x,5,[]);
For convenience, you can also leave one of the dimensions blank
when calling reshape and that dimension will be calculated
automatically.
https://matlabacademy.mathworks.com/R2022a/portal.html?course=mlbe#chapter=3&lesson=4§ion=1 4/4