Must be a text scalar when using eval() function problems?
65 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Ryan
le 28 Sep 2022
Réponse apportée : Walter Roberson
le 28 Sep 2022
n_stress = F./(t.*w);
n_stress = eval(n_stress);
Error using eval
Must be a text scalar.
Error in Carbon90 (line 55)
n_stress = eval(n_stress);
I am unsure as to why I am having issues using the eval() function with a something(underscore)something as the argument because I have not had this problem before.
0 commentaires
Réponse acceptée
Walter Roberson
le 28 Sep 2022
eval() is defined only for character vectors and string scalars. It is not defined for numeric values, and it is not defined for symbolic expressions.
If you have a symbolic expression that does not have any unbound variables then you should double() the expression. If it has unbound variables then vpa() the expression.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Characters and Strings 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!