Please see attached file. variables t and v represent time and velocity respectively. Z being the condition. I want to calculate average acceleration over the points where the condition is '1', and not when the condition is '0'.
I also want the calculation to be specific to the '1' sections. In other words, calculate the average acceleration for the first section where z is 1, and make that a vector value. Then calculate a separate average acceleration for the second section where z is '1', and so on for the rest of the data.
clear;clc;%----------------------------------------------------
uiimport %importing said csv file
while (1) %keeps code from running while selecting a file
cont=input('Press 1 then enter to continue:','s');if cont=='1'breakendendwrdvec = size(t);a = repmat('1',[wrdvec,1]);b = int2str(z)abc = a==bav = v(2:end,:) - v(1:end-1,:)at = t(2:end,:) - t(1:end-1,:)av = av./at;avv = zeros(20,1);for f = find(abc) avv(f) = avend
Best Answer