Plotting a Sequence over a Given Interval
์ด์ ๋๊ธ ํ์
I am trying to plot the follwing sequence,
๐ฅ(๐) = ๐[๐ข(๐) โ ๐ข(๐ โ 10)]+ 10๐ โ0.(๐โ10) [๐ข(๐ โ10) โ ๐ข(๐ โ 20)]
Over this interval
0 โค ๐ โค 20
I already have some code from a previous attempt at this type of problem which is as follows,
% USMPL Function %
function delta = usmpl(n)
if n == 1
delta = 1
else
delta = 0
end
% Main Code %
n = -10:10
x = zeros(length(n)
for k = 1:length(n)
x(k) = 2*usmpl(n(k)+ 1) - usmpl(n(k)-6);
end
stem(n,x)
The problem I am having is working out what to put where in this code to make it work for this problem.
Thanks.
๋๊ธ ์: 4
Star Strider
2021๋
1์ 9์ผ
This part:
makes no sense.
Care to clarify?
Connor Wright
2021๋
1์ 9์ผ
Star Strider
2021๋
1์ 9์ผ
Regardless of what โnโ is, that simply evaluates as 10, since
always evaluates as 1.
Example โ
n = 42;
expr = 10*exp(-0*(n-10))
.
Connor Wright
2021๋
1์ 9์ผ
์ฑํ๋ ๋ต๋ณ
์ถ๊ฐ ๋ต๋ณ (0๊ฐ)
์นดํ ๊ณ ๋ฆฌ
๋์๋ง ์ผํฐ ๋ฐ File Exchange์์ Creating and Concatenating Matrices์ ๋ํด ์์ธํ ์์๋ณด๊ธฐ
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
