what i did for q1 was
for x = 1:length(data) - for x = 1 to the number of elements in data,
if data(x) < 0, new_data(x) = 0 - if the x element (1st, 2nd, 3rd etc) in the data is less than 0, the x element in new data = 0
elseif mod(ceil(data(x))) , 2) == 1, new_data(x) = floor(data(x)) - mod(ceil(data(x)) , 2) == 1 is just saying that if i round the element within the data up and its odd, then round it down since it's the closest even integer
elseif mod(ceil(data(x))), 2) == 0, new_data(x) = ceil(data(x)) - same thing as above except we round it up
end
end
so the for loop is saying: for every element (1,2,3 to the max number of elements) in this vector, if something matches, do this, else if ... do this .... etc.