Help with Matlab homework question
์กฐํ ์: 3 (์ต๊ทผ 30์ผ)
์ด์ ๋๊ธ ํ์
๐๐+1 = ๐๐ 2 + 0.25
Considering the relation, calculate and record the value of the relation for each value of n,
Write a computer program that will output the result for only n = 0, 5, 10, 15,โฆ values.
n = 0,1,2,3,โฆ., N
N=54
๋๊ธ ์: 4
Image Analyst
2021๋
5์ 25์ผ
There is something missing between the n and the 2.
Do you mean x(n+1) = x(n) * 2 + 0.25 or what????
n = 0 : N
x(1) = 0;
for k = 2 : length(n)
index = n(k) + 1; % Index can't start at 0. It needs to start at 1.
x(index + 1) = x(index) * 2 + 0.25;
end
x % Show x for all values of n in command window.
๋ต๋ณ (2๊ฐ)
Sulaymon Eshkabilov
2021๋
5์ 24์ผ
Use colon operator ":" to generate the series of x(n+1). And to select or take out only n = 0, 5, 10, 15,โฆ54 values, use again ":", e.g. 1:5:54
Good luck.
Sulaymon Eshkabilov
2021๋
5์ 24์ผ
What you are computing is not quite correct. But you have done some attempt.
Here is a simple solution
n = 1:54;
x(1)=0;
for ii = n
x(ii+1)=x(ii)^2+.25;
end
X_out = x(1:5:54);
OUT = [(0:5:54);X_out];
fprintf(' n Output: \n')
fprintf('x(%d) = %f \n', OUT)
๋๊ธ ์: 2
์ฐธ๊ณ ํญ๋ชฉ
์นดํ ๊ณ ๋ฆฌ
Help Center ๋ฐ File Exchange์์ Matched Filter and Ambiguity Function์ ๋ํด ์์ธํ ์์๋ณด๊ธฐ
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!