Numerical function invalid expression
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Leon Ellis
am 2 Aug. 2021
Bearbeitet: the cyclist
am 2 Aug. 2021
I want to defind a function numerically. The function is ((e^2x)*tan(x))/x^3).
I'm using h=@(x)exp(2x).*tan(x)./x.^3 to defind it but it says invalid expression. Please help and thanks in advance.
0 Kommentare
Akzeptierte Antwort
the cyclist
am 2 Aug. 2021
Bearbeitet: the cyclist
am 2 Aug. 2021
You need the explicit multiplication sign 2*x:
h=@(x)exp(2*x).*tan(x)./x.^3
You might also want to put in some parentheses instead of relying on the order of operations, to be certain the expression is evaluated in the order you expect.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!