Summation with for LOOP
이전 댓글 표시
Hello,
I have a function y that is repeated after a certain interval of T. I want to add the value of the previous y to the next value. The proplem is more clear with a diagram as shown below


I want to add the value of the each T to like,

How can I sumUp all the inteaction with a for Loop,like this expression?

here is my code for info
clear
clc
x = linspace(0,50,1000);
v = 10;
a = 0.2254; b = 0.5401;
xT = 0;
for i = 1:4
xT = xT+v;
y = @(x) ((a*((x-xT)).^-b).*(x>=(xT+1))).^2;
figure(3)
hold on
plot(x,y(x))
end
Merci
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
