필터 지우기
필터 지우기

Divide by every N rows

조회 수: 3 (최근 30일)
david crowley
david crowley 2021년 8월 8일
답변: KSSV 2021년 8월 8일
I am trying to perform the following calculation, but every 52 rows the denominator needs to change from (1,1) to (52,1) then (104,1) etc.
Can someone please assist?
rAPf(i,:) = ((tickPf(i,1) / tickPf(1,1))-1)*100;

채택된 답변

KSSV
KSSV 2021년 8월 8일
t = 1 ;
for i = 1:n % n should be your last index
if mod(i,52) == 0
t = i ;
end
rAPf(i,:) = ((tickPf(i,1) / tickPf(t,1))-1)*100;
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by