To write a vector in Matlab, use square brackets [] with the elements of the vector separated by semicolons or spaces, depending on how you want to visualize the vector. For example, to create a row vector of numbers 1 to 5, you can use:
main.m20 chars2 lines
Similarly, to create a column vector with the same elements:
main.m16 chars2 lines
You can also create a vector using the colon operator (:), where you specify the start, step, and end values. For example, to create a vector of even numbers from 2 to 10:
main.m11 chars2 lines
This will create a row vector with elements [2, 4, 6, 8, 10].
gistlibby LogSnag