Using an apostrophe with fprintf
Mostrar comentarios más antiguos
How do I include an apostrophe within my text while using the fprintf command? For example, fprintf('Avogadro's constant is 6.022e+23 molecules/mole.\n') will not work because the apostrophe in "Avogadro's" ends the text segment.
Respuesta aceptada
Más respuestas (1)
Roger Stafford
el 16 de Feb. de 2015
Use double apostrophe just as you would in any matlab string:
fprintf('Avogadro''s constant is 6.022e+23 molecules/mole.\n')
Categorías
Más información sobre Characters and Strings en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!