In fi >= non-fi, or non-fi >= fi, the non-fi must be a constant

Hello There,
I'm converting a Matlab (.m) file to fixed point
"Function call failed."
"In fi <= non-fi, or non-fi <= fi, the non-fi must be a constant."
Here is my code -----------------
x=amp*sin_vec(2*pi*f*t); % Sinusoid input singal (Hz)
jj=-(amp-Delta):Delta:(amp-Delta);
for j=1:jx
for k=1:1:km
if (x(k)>=jj(j)) % <---- error at this line
end
end

 Respuesta aceptada

Walter Roberson
Walter Roberson el 21 de Mayo de 2015
One of those two variables, x or jj, is in fixed point and the other one is not. You need to make both of them fixed point.

3 comentarios

Tamer
Tamer el 3 de Jun. de 2015
Thank you Walter, your advise helped me to solve this problem.
I just wrote the following commands, and the problem fixed
x=fi (x,true,16,16);
jj=fi (jj,true,16,16);
dears, how can I make the variables as fixed point?
Tamer showed
x=fi (x,true,16,16);
which is an example of making x into a fi. You would need to adjust the parameters of the fi() call to be appropriate for the situation.

Iniciar sesión para comentar.

Más respuestas (0)

Preguntada:

el 21 de Mayo de 2015

Comentada:

el 26 de Abr. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by