Info
此问题已关闭。 请重新打开它进行编辑或回答。
For loop help... :(
1 次查看(过去 30 天)
显示 更早的评论
Regards,
I'm working on a big code, but i'm having trouble in this section:
for k=1:(t-1)
fo(k) = ((time(k+1)-time(k))/2)*(10^((Tpf(k+1)-Tr)/z)+10^((Tpf(k)-Tr)/z));
foo = sum(fo);
if foo<ff
tc = tp;
elseif foo>=ff
tc = ......;
end
end
Time, tpf are vectors. Tr, z, tp, ff are constants.
Imaging a heating problem, where tp is my process time. I want, when foo reach ff ammount, the time tc (wich would me the "start cooling" time) get the value of that time(k) iteration as a contant. Because it's in the loop, if i use tc = time(k) it will keep changing. I want when my foo reach ff, get the time(k) = constant, so afterwards in my code, that tc gives the initiation of my cooling process.
Thanks, i hope i explained it decent. Any questions please ask.
0 个评论
回答(1 个)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!