Help regarding "Attempted to access gainx(0.0101768); index must be a positive integer or logical." error.

Hi,
I'm not particularly competent with MATLab but I'm trying to create some basic parametric filters and I'm running into an error which I'm struggling to determine. I've found people with the same error message online but I've not understood the advice they've been given because again, I'm new to this and have only very basic knowledge.
I'm getting this error:
"Attempted to access gainx(0.0101768); index must be a positive integer or logical."
...in regards to this:
%
Q = 3.5;
Fc = 500;
gaindB = -10.00;
Fbw = Fc/Q;
Fs = 44100;
R = 1 - (pi*Fbw)/Fs;
gainx = db2mag(gaindB);
r = 1 - gainx(1-R);
omegat = (2*pi*Fc)/Fs;
A simple explanation would be welcome if anyone knows, thanks.

 Accepted Answer

Matlab needs * to denote multiplikation:
gainx = 1 - gainx*(1-R);
Does this solves your problem?

More Answers (0)

Asked:

T
T
on 18 Dec 2014

Answered:

on 19 Dec 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!