Undefined operator '+' for input arguments of type 'function_handle'.
Mostra commenti meno recenti
fun = @(Jw) kh_1./(Jw+kh_1); int=integral(fun,hrootzone,hgwt);
Risposte (1)
Star Strider
il 2 Nov 2017
I cannot reproduce that error with the code you posted (assuming ‘kh_1’, ‘hrootzone’, and ‘hgwt’ are double-precision values).
As a general rule, if you want to add (or do other operations on) functions, you have to evaluate them as functions.
Example —
f1 = @(x) x.^2;
f2 = @(x) 2*x;
f3 = @(x) f1(x) + f2(x); % Create New Anonymous Function To Sum Other Functions
x = 2;
y = f3(x);
Categorie
Scopri di più su Just for fun in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!