Clear symbolic from an equation and make it mathematical function
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Nikolas Spiliopoulos
am 20 Sep. 2021
Kommentiert: Nikolas Spiliopoulos
am 20 Sep. 2021
Hi all,
I have an equaton of x, using syms x to create it.
However afterwards I want to clear the symbolic value and convert it to a mathematical function f(x), in order to represent it graphically for various x values.
I tried it manually by just doing copy paste, but the problem is that I get an error ",x" meaning I need again manually to fix it.
Is it possible to do it automatically?
thanks
example
syms x
f=(17*exp((281*x)/50000))/1000 + (4777*x*exp((281*x)/50000))/50000000
afterwards in order to put values (without symbolic values) it should be like that (using ".x"):
x=4.5:1:40.5;
g=(17*exp((281*x)/50000))/1000 + (4777*x.*exp((281*x)/50000))/50000000;
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 20 Sep. 2021
syms x
f=(17*exp((281*x)/50000))/1000 + (4777*x*exp((281*x)/50000))/50000000
ff = matlabFunction(f);
x=4.5:1:40.5;
plot(x, ff(x))
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Symbolic Math Toolbox 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!