how to solve this error?
4 views (last 30 days)
Show older comments
??? Error using ==> lti.subsref at 56
Use two or more subscripts to select or delete all elements,
as in the "sys(:,:)" command.
Error in ==> conv at 40
c = conv2(a(:),b(:),shape);
Error in ==> secondary at 14
d1=conv(s,y);
my code is
function x=signal(f,fs,N)
% sinusoid
f=30; %frequency,
N=20; %number of samples
fs=100; %sampling frequency
A=2; %amplitute
%Total sampling time = 1 second
n = 0:N-1; % numbering the samples
x = A*sin(2*pi*f*n/fs);
w=0.3;
[b,a]=butter(N,w);
y = filter(b,a,x);
s=tf([0.4923 0.96 1 0],[0.3352 1.06 1]);
d1=conv(s,y);
ff_sec = abs(fft(d1,1024));
subplot(2,1,1);
plot(d1)
subplot(2,1,2);
plot(ff_sec,'m');
0 Comments
Answers (0)
See Also
Categories
Find more on Fixed-Point Filters 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!