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

30 次查看(过去 30 天)
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

采纳的回答

Walter Roberson
Walter Roberson 2015-5-21
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 个评论
Walter Roberson
Walter Roberson 2021-4-26
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.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Structures 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by