필터 지우기
필터 지우기

Undefined function or variable 'fabs'

조회 수: 19 (최근 30일)
Oliver Lestrange
Oliver Lestrange 2020년 8월 29일
편집: Bruno Luong 2020년 8월 29일
Hi,
I'm getting this error: "Undefined function or variable 'fabs'."
The code is:
for z=1:length(altura_raio_direto)
delta_h = altura_raio_direto(z) - (m * z + b);
raio_elipsoide = sqrt(...
(z * abs(dv - z) * lambda)/dv...
)
if (delta_h>0) | (delta_h<0 & fabs(delta_h)<0.6*raio_elipsoide)
LOS = 0;
disp('Is going to exit - NLOS');
break
end
end
Any ideia how this error occurs?
Thanks!

답변 (1개)

Bruno Luong
Bruno Luong 2020년 8월 29일
편집: Bruno Luong 2020년 8월 29일
Replace
fabs(delta_h) < 0.6*raio_elipsoide
with
abs(delta_h) < 0.6*raio_elipsoide % or -delta_h < 0.6*raio_elipsoide
It seems someone translates a C code to MATLAB code without care.

카테고리

Help CenterFile Exchange에서 Software Development Tools에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by