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

1 Ansicht (letzte 30 Tage)
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.

Akzeptierte Antwort

Thorsten
Thorsten am 19 Dez. 2014
Matlab needs * to denote multiplikation:
gainx = 1 - gainx*(1-R);
Does this solves your problem?

Weitere Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by