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!