I have a row matrix defined as:
I want to create a vector that its elements are the half subtraction of two subsequent elements of vector s. My attempt to do that is the follwoing:
for i = 1:length(s)-1
for j = 2:length(s)
Mid_s = (s(j)-s(i))/2;
However, the result I'm having is just one number. How can I have all numbers resulted from the "for" loop as an array/vector?