What is a good way (other than ~=) to represent that a variable does not contain NaN values in R2013?
Show older comments
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! :)
Accepted Answer
More Answers (0)
Categories
Find more on Timetables in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!