Summary of MATLAB Onramp Basic Syntax Example Description
Summary of MATLAB Onramp Basic Syntax Example Description
Basic syntax
Example Description
Desktop management
Array types
Example Description
4 scalar
[3 4 5;6 7 8 matrix
]
Evenly-spaced vectors
Example Description
Creating matrices
Example Description
Indexing
Example Description
A(end,2) Access the element in the second column of the last row.
Array operations
Example Description
ans =
4 4
Example Description
4 4
ans =
2 2
2 2
Multiple outputs
Example Description
[xrow,xcol] = size(x Save the number of rows and columns in x to two different variables.
)
[xMax,idx] = max(x) Calculate the maximum value of x and its corresponding index value.
Documentation
Example Description
Plotting
Example Description
Using tables
Example Description
Logicals
Example Description
x(x==999) = 1 Replace all values in x that are equal to 999 with the value 1.
Programming
Example Description
y=4
end
disp(c)
The loop body displays each value of c.
end