Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

how could i print '%' in matlab? using fprintf

2 vues (au cours des 30 derniers jours)
Jaybee
Jaybee le 1 Oct 2013
Clôturé : MATLAB Answer Bot le 20 Août 2021
code:
fprintf('%d is my age, i got %d % in my test\n',19,100)
desired output: 19 is my age, i got 100 % in my test
so the problem is that i cant print the '%' character, how could I do that?
thanks in advance! :D

Réponses (1)

Wayne King
Wayne King le 1 Oct 2013
fprintf('%d is my age, i got %d %%in my test\n',19,100)
  1 commentaire
Jan
Jan le 1 Oct 2013
@Jaybee: You can find the answer by reading the documentation: doc fprintf, see the section "formatSpec".

Cette question est clôturée.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by