How to align different lengths words/strings in fprintf?
Ältere Kommentare anzeigen
I am attempting to output strings of varying lengths, including a mix of Chinese and English characters in different cases.(for example "aab"、"AABB_"、"不好玩") However, when I use MATLAB to format the output, I observe that even though I have set a fixed width for formatting , the displayed widths of different strings are not equal. This results in misalignment in the data display, as shown in the image below."

How can i deal with this condition so that all strings can be displayed in equal width .
1 Kommentar
Stephen23
am 15 Jan. 2024
"How can i deal with this condition so that all strings can be displayed in equal width ."
You will need to use a fixed-width font.
It is clear from the posted screenshot that you are currently using a variable-width font. That will not work.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Entering Commands finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!