My current code is aiming to perform basic arithmetic on a variable, but only if it contains values. I don't want to necessarily remove null values, but just find a good way of saying if my variable, data, actually contains some threshold of values, it can continue to do this basic arithmetic. My current code is as follows:
if data ~= isnan average_length = 150; means = []; datalength = size(data,1); speed =data(:,1); insta_rate = data(:,2); for count = 1:average_length:datalength if count+average_length > datalength mean_speed = mean(speed(count:datalength)); mean_insta_rate = mean(mean(count:datalength)); end end end
Thanks! 🙂
Best Answer