Anonymous Function with natural log inside
显示 更早的评论
I am trying to make an anonymous function with a natural log inside. Here is my code:
p = @(h)29.921*(1 - 6.8753*10^-6.*h);
T = @(p)49.161*log(p) + 44.932;
h = -500:14439;
p(h);
T(p);
plot(h,T(p))
When I run it, I get this error:
Undefined function 'log' for input arguments of type 'function_handle'.
Error in Elevation>@(p)49.161*log(p)+44.932
Error in Elevation (line 10)
T(p);
Is it because p is an anonymous function, too? Or is it something else? How can I fix this?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Programming Utilities 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!