How can I use a floating point number with input command?
조회 수: 30 (최근 30일)
이전 댓글 표시
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
채택된 답변
Stephen23
2021년 10월 12일
L = 10;
S = sprintf('Enter the location of the force (0 - %0.2f meters): ',L);
a = input(S);
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!