How can I use a floating point number with input command?
26 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Gavin Thompson
le 12 Oct 2021
Commenté : Gavin Thompson
le 12 Oct 2021
L = 10
a = input('Enter the location of the force (0 - %0.2f meters): ');
How can I get the prompt to output as 'Enter the location of the force (0 - 10.00 meters): '.
0 commentaires
Réponse acceptée
Stephen23
le 12 Oct 2021
L = 10;
S = sprintf('Enter the location of the force (0 - %0.2f meters): ',L);
a = input(S);
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!