plotting delta function in zero interpolation and decimation
Show older comments
clc;
close all;
clear all;
x1= [1 2 3 4 5];
L = 2;
n = linspace(0,4,100);
m =linspace(0,10);
h1 = dirac(n - m*L);
idx = h1 == Inf;
h1(idx) = 1;
h2 = dirac(n-m/L);
idx = h2 == Inf;
h2(idx) = 1;
figure (1);
subplot(1,2,1);
for i = 1:numel(n);
for j = 1:numel(m);
y1{i,j} = conv(x1,h1(i,j));
plot(y1{i,j});
end
end
subplot(1,2,2);
for i = 1:numel(n);
for j = 1:numel(m);
y2{i,j} = conv(x1,h2(i,j));
plot(y2{i,j});
end
end
Hi all, this is my code, and I want to plot like the picture result. They say "Index in position 1 exceeds array bounds (must not exceed 1)". Please help me, what is wrong in my code?
Accepted Answer
More Answers (0)
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!