Adding numbers to an array
古いコメントを表示
Im trying to add values into an array using a for loop. This is my function but I hard coded it to work. Please help!
function[t1, t2, t3, t4, t5, t6, timeArr, maxArr, minArr, diagnosisArr] = findSinusArrhythmia(time, locationsR)
t1 = time(locationsR(7)) - time(locationsR(6));
t2 = time(locationsR(6)) - time(locationsR(5));
t3 = time(locationsR(5)) - time(locationsR(4));
t4 = time(locationsR(4)) - time(locationsR(3));
t5 = time(locationsR(3)) - time(locationsR(2));
t6 = time(locationsR(2)) - time(locationsR(1));
timeArr = [t1, t2, t3, t4, t5, t6];
maxArr = max(timeArr);
minArr = min(timeArr);
diagnosisArr = maxArr - minArr;
end
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!