You can use the following code to create an array of indices in MATLAB:
main.m59 chars3 lines
In this code, we first create an array price1 with some sample values. Then, we create another array indices that starts at 1 and ends at the length of price1 using the length function.
This will create an array indices with values [1, 2, 3, 4, 5] in this example.
gistlibby LogSnag