Undefined function 'log10' for input arguments of type 'embedded.fi'.
8 views (last 30 days)
Show older comments
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 Comments
Answers (2)
Ahmed raafat
on 17 Oct 2017
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 Comments
Walter Roberson
on 17 Oct 2017
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 Comments
See Also
Categories
Find more on Interpolation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!