Using text, 2 variables, and decimals in fprintf
Mostra commenti meno recenti
fprintf(["The value you entered "+'%.1f°C\n',temp + "is equal to "+'%.1f°F\n',ans])
Can someone help me make this line work. I feel like I'm close but I keep getting errors.
Risposta accettata
Più risposte (1)
Cris LaPierre
il 26 Set 2020
The documentation page is a great place to start. There, you'll see that the variables have to come at the end. Also, you don't need square brackets.
fprintf("The value you entered "+'%.1f°C\n' + "is equal to "+'%.1f°F\n',10,20)
The value you entered 10.0°C
is equal to 20.0°F
Categorie
Scopri di più su Whos in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!