Error using log Not enough input arguments. This is the error message I keep getting. Pls help
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
%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 commentaires
Réponses (2)
Chunru
le 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 commentaires
Walter Roberson
le 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 commentaires
Voir également
Catégories
En savoir plus sur Semiconductors and Converters dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!