Undefined function 'log10' for input arguments of type 'embedded.fi'.
조회 수: 3 (최근 30일)
이전 댓글 표시
Dear All,
Can you help me to understand this error message and how to avoid these errors?
Here is the longer version of the message:
Undefined function 'log10' for input arguments of type 'embedded.fi'.
Error in parameterFun (line 9)
part2 = log10(part1);
Error in procDataFit>@(x,f)parameterFun(x,f)
The error emerges when I try to use the optimization toolbox to do a curve fitting. The equation for this work is stored in a separate function file (the code is below) and I call the function as
x = [fr(i),g0,K,offset];
fun = @(x,f)parameterFun(x,f);
x = lsqcurvefit(fun,x,fi,RINData);
------------ the code of annonymous function parameterFun.m -----------
function minRin = parameterFun(x,f)
dFactor = ( x(2) + x(3));
part1 = ((f.*1e6).^2+(dFactor./(2.*pi)))
part2 = log10(part1);
minRin = x(4) + 10*part2;
댓글 수: 0
답변 (2개)
Ahmed raafat
2017년 10월 17일
to get log10 for numeric data you could use this old rule
log(x) to base y = ln(x)/ln(y)
so log10(x)
you can change it to
log(x)/log(10)
댓글 수: 0
Walter Roberson
2017년 10월 17일
log is not supported by fi at all, not even by the CORDIC algorithms.
You might be interested in https://www.quinapalus.com/efunc.html or in http://people.sc.fsu.edu/~jburkardt/f_src/fn/fn.html
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!