Please help me vectorizing the following code
显示 更早的评论
n=2:nt;
sum1(n)=f(t(n),alpha)+(var).*bj(n).*u(1);
k=1:n-1;var_bj=(bj(k+1)-bj(k)).*(var);
for n=2:nt
sum2=0;
for k=1:n-1
sum2=sum2+var_bj.*u(n-k);
end
sumout2(n)=sum2;
u(n)=(sum1(n)-sumout2(n))/(var-beta);
end
1 个评论
Alexandra Harkai
2017-3-14
Tell us more about the variables you have, for example, what are their sizes? What is your code trying to do?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Programming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!