# generate y(n)=y(n-1)+x(n)

์กฐํ ์: 68 (์ต๊ทผ 30์ผ)
Marwan Malaeb 2017๋ 4์ 20์ผ
๋๊ธ: Joshua Iascau 2022๋ 4์ 13์ผ
hello i want to generate y(n)=y(n-1)+x(n). by using a for loop I can find the last value of y, but i need to store all values of y from n =1 till n. Who do I do that?
##### ๋๊ธ ์: 0์ด์  ๋๊ธ -2๊ฐ ํ์์ด์  ๋๊ธ -2๊ฐ ์จ๊ธฐ๊ธฐ

๋๊ธ์ ๋ฌ๋ ค๋ฉด ๋ก๊ทธ์ธํ์ญ์์ค.

### ์ฑํ๋ ๋ต๋ณ

Azzi Abdelmalek 2017๋ 4์ 20์ผ
n=10
y0=0; % Initial conditions
y(1)=y0+x(1);
for k=2:n
y(k)=y(k-1)+x(k)
end
##### ๋๊ธ ์: 1์ด์  ๋๊ธ -1๊ฐ ํ์์ด์  ๋๊ธ -1๊ฐ ์จ๊ธฐ๊ธฐ
Marwan Malaeb 2017๋ 4์ 20์ผ
that is right, thanks Azzi.

๋๊ธ์ ๋ฌ๋ ค๋ฉด ๋ก๊ทธ์ธํ์ญ์์ค.

### ์ถ๊ฐ ๋ต๋ณ (2๊ฐ)

Roger Stafford 2017๋ 4์ 20์ผ
That is precisely what the matlab โcumsumโ function does:
y = cumsum(x);
##### ๋๊ธ ์: 1์ด์  ๋๊ธ -1๊ฐ ํ์์ด์  ๋๊ธ -1๊ฐ ์จ๊ธฐ๊ธฐ
Joshua Iascau 2022๋ 4์ 13์ผ
you said what?

๋๊ธ์ ๋ฌ๋ ค๋ฉด ๋ก๊ทธ์ธํ์ญ์์ค.

polat kayhan 2021๋ 5์ 24์ผ
๐๐+1 = ๐๐ 2 + 0.25
Information about its relation, calculate the value of its relation for a value of n, register
Write a computer program whose result will be output for n = 0, 5, 10, 15,โฆ communication only.
n = 0,1,2,3,โฆ., 54
##### ๋๊ธ ์: 0์ด์  ๋๊ธ -2๊ฐ ํ์์ด์  ๋๊ธ -2๊ฐ ์จ๊ธฐ๊ธฐ

๋๊ธ์ ๋ฌ๋ ค๋ฉด ๋ก๊ทธ์ธํ์ญ์์ค.

### ์นดํ๊ณ ๋ฆฌ

Help Center ๋ฐ File Exchange์์ Structures์ ๋ํด ์์ธํ ์์๋ณด๊ธฐ

### Community Treasure Hunt

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

Start Hunting!

Translated by