turn a vector into a scalar
42 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi,
I have a vector
Matlab is telling me that this is 1x1 sym, but I need it to be a scalar.
How can I convert this?
Thanks you
1 commentaire
Ameer Hamza
le 19 Nov 2020
g=0.1178542134 is already a scalar. Can you give example of code which gives error?
Réponses (1)
Rik
le 19 Nov 2020
I guess boldly:
g=sym('0.1178542134')
g_=double(g) %convert the scalar sym to a scalar double
2 commentaires
Rik
le 23 Nov 2020
Why did you edit your question?
And if my answer solved your problem, please consider marking it as accepted answer. If not feel free to comment with your remaining issues.
Voir également
Catégories
En savoir plus sur Conversion Between Symbolic and Numeric 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!