display different colors in command window, using command "disp" or similar

301 visualizaciones (últimos 30 días)
Per
Per el 25 de En. de 2013
Respondida: Chunguang LI el 20 de Abr. de 2021
I want sections of my display to be in differnt colors. (Matlab 2009)
ex:
disp('Hello matlab Central!')
Is it possible to get that text in example red?
disp('Hello matlab Central','red')
Thanks
  1 comentario
Ronald Hartwig
Ronald Hartwig el 27 de Oct. de 2018
Apparently not. With more current version, simple things like cprintf and fprintf are not valid either.

Iniciar sesión para comentar.

Respuestas (2)

Chunguang LI
Chunguang LI el 20 de Abr. de 2021
fprintf(2,'only red\n'); %2 for standard error.

Evgeny Pr
Evgeny Pr el 25 de En. de 2013
Use cprintf function.
This is an undocumented feature!

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by