I need to make a script file on Octave where, when given an input variable VEC1 and INC (where VEC1 is a vector of floating point numbers and INC is a single integer), a subvector of VEC1 is produced. This subvector should include all entries of of VEC1 starting at the second entry and includes all indices separated by INC and then stores the result in VEC2. For example: VEC1= [1 2 3 4 5 6 7 8 9 10]; INC = 4;
It should produce VEC2 = 2 6 10
What i did was: size = length(vec1); VEC2 = VEC1(2):INC:VEC1(size)
But it doesnt work
Octave is case-sensitive. So you need to be consistent in keeping your variable names lowercase or uppercase, e.g.