How to use str2func with a function handle in the string
Mostra commenti meno recenti
Hi,
I want to insert a function handle in the input string of str2func but I get an error.
string1 = '@(x)sin(x)';
A = str2func(string1);
string2 = '@(x,y)(A(x) + sin(y))'
B = str2func(string2);
B(pi/2,pi/2)
It says: Undefined function or variable 'A'.
How can I fix it?
Thanks
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Number Theory 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!