Why won't this compute?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
James Panhorst
le 23 Jan 2019
Réponse apportée : Image Analyst
le 23 Jan 2019
(10/13)-(18/(5(7))-5(9sqrt(2))
0 commentaires
Réponse acceptée
Star Strider
le 23 Jan 2019
I’ve never seen that syntax in any programming language I’ve ever encountered.
If I parse it as:
strange_expression = (10/13)-(18/(5*7)-5*9*sqrt(2))
it evaluates to
strange_expression =
63.8946
I have absolutely no idea if that is correct.
2 commentaires
Star Strider
le 23 Jan 2019
My pleasure!
If my Answer helped you solve your problem, please Accept it!
Plus de réponses (1)
Image Analyst
le 23 Jan 2019
When you see things in a book that are like y = mx+20b, where variables and/or numbers are right next to each other, in a computer language you need to separate them with a multiplication operator, like
y = m * x + 20 * b
So 5(7) is really 5 * (7) which is 5 * 7.
And 9sqrt(2) is really 9 * sqrt(2).
0 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!