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 日

0 投票

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 件)

カテゴリ

ヘルプ センター および File ExchangeGet Started with MATLAB についてさらに検索

タグ

質問済み:

2021 年 8 月 8 日

回答済み:

2021 年 8 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by