While loop to get a specific section of data
古いコメントを表示
resp = [];
ii = 1;
n = 720000;
go = 0;
while ii < length(acq2.data(:,4))
if acq2.data(ii,4) > 1 && go == 0
resp(ii) = acq2.data(ii,3);
go = 1;
else
ii = ii + 1;
end
jj = 1;
if go == 1 && jj < n
resp(ii) = acq2.data(ii,2);
jj = jj + 1;
end
if go == 1
ii = ii + 1;
end
end
So basically what I am trying to do here is use column 4 data (which ranges from 0.1 when it is resting and it jumps up to 5 when it is active) so I want to start moving data into the new array at the first instance ii when the data in column 4 jumps up to 5 (in this case when it is greater than 1). Since I only want this to happen once I made sure go at first equals 0 and when this condition is first met it then becomes g=1 so that it does not repeat that aspect of the code. So ideally this will create a new column of data in the new array resp where it starts at some point ii where the data in column 4 first is greater than 1 and then it ends some 720000 points later.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!