如何使用 MATLAB 中的 sprintf 函数打印百分号字符?

14 visualizaciones (últimos 30 días)
MathWorks Support Team
MathWorks Support Team el 27 de Sept. de 2019
Respondida: MathWorks Support Team el 27 de Sept. de 2019
当我执行“sprintf('100%')”时,获得的结果是“100”而不是“100%”

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 27 de Sept. de 2019
当需要转译百分号时,使用两个百分号表示,例如:
sprintf('100%%')
打印的结果是100%
源链接:www.mathworks.com/matlabcentral/answers/102505-how-do-i-print-a-character-using-sprintf-in-matlab-7-7-r2008b

Más respuestas (0)

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Productos


Versión

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!