tcprintf : ANSI colored output in terminal

tcprintf provides colored output when using MATLAB from a terminal using ANSI escape codes.
861 téléchargements
Mise à jour 20 sept. 2012

Afficher la licence

Uses ANSI escape codes to print colored output when using MATLAB
from a terminal. If not running in a terminal, or if called by MATLAB's
datatipinfo function, tcprintf reverts to standard printf. The latter is
desirable if tcprintf is used within an object's disp() method to avoid
seeing the ANSI characters here.

The first argument is an style description that consists of space-separated
words. These words may include:

one of the following colors:
black, red, green, yellow, blue, purple, cyan, darkGray, lightGray, white

one of the following background colors:
onBlack, onRed, onGreen, onYellow, onBlue, onPurple, onCyan, onWhite

and any of the following modifiers:
bright : use the bright (or bold) form of the color, not applicable for
black, darkGray, lightGray, or white
underline : draw an underline under each character
blink : This is a mistake. Please don't use this ever.

tcprintf('lightGray onRed underline', 'Message: %20s\n', msg);

Author: Dan O'Shea ( (c) 2012

Released under the open source BSD license

Citation pour cette source

Daniel J O'Shea (2024). tcprintf : ANSI colored output in terminal (, MATLAB Central File Exchange. Récupéré le .

Compatibilité avec les versions de MATLAB
Créé avec R2011b
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux
En savoir plus sur Debugging and Analysis dans Help Center et MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Publié le Notes de version