Undefined function 'log10' for input arguments of type 'embedded.fi'.
显示 更早的评论
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;
回答(2 个)
Ahmed raafat
2017-10-17
0 个投票
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)
Walter Roberson
2017-10-17
0 个投票
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
类别
在 帮助中心 和 File Exchange 中查找有关 Structural Mechanics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!