How to calculate price weighted function?
1 次查看(过去 30 天)
显示 更早的评论
I'm trying to calculate the following function in Matlab. This is what I have tried so far but it gives me NaN. Can someone help?
0 个评论
回答(1 个)
Mahmoud Ashraf
2022-4-28
avg=rand(1,505);
sum=0;
for j=1:505
sum=sum+avg(1,j);
end
for m=1:505
pweight(1,m)=avg(1,j)/sum;
end
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Financial Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!