Taking a descend interval

1 次查看(过去 30 天)
for t=1:n
[L(t)]=(1/(50)^(t))
[C(t)]=(1/(800))^(t);
end
For the 1st line (L(t)) i need to use the interval 1:n however for the 2nd line i need from n:1. How do i change t without changing the interval in the for loop?

采纳的回答

Alan Stevens
Alan Stevens 2021-3-5
Insert
tau = n+1-t;
then raise 1/800 to the power tau.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by