Assuming you want to store the values -10
and 70
in a variable ly
, you can define ly
as a row vector using square brackets []
as follows:
main.m15 chars2 lines
If you want to define ly
as a column vector instead, use a semicolon ;
to separate the values:
main.m16 chars2 lines
You can then access the values stored in ly
using indexing. For example, ly(1)
returns -10
and ly(2)
returns 70
.
gistlibby LogSnag