To make a 5-long row vector in MATLAB, you can use the following code:
main.m21 chars2 lines
This creates a row vector called x
with the values 1, 2, 3, 4, and 5. You can also create a row vector using the linspace
function, which generates a vector of linearly spaced values between two endpoints:
main.m23 chars2 lines
This creates a row vector called x
with the same values as the previous example.
gistlibby LogSnag