Error using log Not enough input arguments. This is the error message I keep getting. Pls help
2 views (last 30 days)
Show older comments
%Write a .m script file that defines these two functions as anonymous functions and then plots
%boiling temperature against altitude in the range from ’500 ft to 14,439 ft (Colorados highest point).
clear all
h = linspace(-500, 14439, 1000);
p = @(h) 29.92 * (1 - 6.8753 * 10 .^(-6) * h);
p(h)
T = @(p) 49.161 .* log.*(p)+ 44.932;
T(p);
fplot(p,T);
0 Comments
Answers (2)
Chunru
on 1 Sep 2021
Don't confuse the function handle with numerical variables.
h = linspace(-500, 14439, 1000);
p = @(h) 29.92 * (1 - 6.8753 * 10 .^(-6) * h);
ph = p(h);
T = @(p) 49.161 .* log(p) + 44.932;
Tp = T(ph);
plot(ph,Tp);
0 Comments
Walter Roberson
on 1 Sep 2021
T = @(p) 49.161 .* log.*(p)+ 44.932;
^^^^^^^^
That means that the code should attempt to invoke the function named log with no parameters, and multiply the result returned by log by the value of p. Unless you do some unusual assignments higher in the code, that line of code is the same as if you had written
T = @(p) 49.161 .* log().*(p)+ 44.932;
0 Comments
See Also
Categories
Find more on Semiconductors and Converters 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!