y = filter(b,a,u);
%reading (durata)seconds of my file info = audioinfo(filename_formato); [y, Fs] = audioread(filename_formato,[1 info.SampleRate * durata]); ns = size(y,1); ts = 1/Fs; %generating time vector t = linspace(0,ts*ns,ns); %designing the filter (let's say Fs = 44100Hz, fstop = 1000Hz) [z,p,k] = ellip(6,0.5,20,fstop/Fs*2); [b,a] = zp2tf(G.Z{1,1},G.P{1,1},G.K); y = filter(b,a,u);
I am assuming you are using MATLAB 2019b. The above issue can be due to linspace. It is generating indices which are not integers (due to numerical approximation errors) and this made matrix indexing fail. You can verify this yourself, if you run the following code in MATLAB R2019b or later:
x = -50:1:50; y = linspace(-50,50,101); % Verify that result is different isequal(x,y) % Show that this makes indexing fail indices = y + 51; A = [1:1000]; B = A(indices);
Matlabsolutions.com provides guaranteed satisfaction with a
commitment to complete the work within time. Combined with our meticulous work ethics and extensive domain
experience, We are the ideal partner for all your homework/assignment needs. We pledge to provide 24*7 support
to dissolve all your academic doubts. We are composed of 300+ esteemed Matlab and other experts who have been
empanelled after extensive research and quality check.
Matlabsolutions.com provides undivided attention to each Matlab
assignment order with a methodical approach to solution. Our network span is not restricted to US, UK and Australia rather extends to countries like Singapore, Canada and UAE. Our Matlab assignment help services
include Image Processing Assignments, Electrical Engineering Assignments, Matlab homework help, Matlab Research Paper help, Matlab Simulink help. Get your work
done at the best price in industry.