Can you change the text color in the terminal command line for Matlab? (Linux)
19 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I know you can customize the colors of the Matlab desktop command window. But I'm wondering if while running matlab -nodesktop, if it's possible to customize the colors of text. So when using the terminal, errors and the prompt would be in whatever color I specify.
0 Kommentare
Antworten (3)
Walter Roberson
am 23 Dez. 2017
No, it cannot be changed to whatever color you specify in that mode. However, you could probably deliberately format some text into a limited number of colors http://www.lihaoyi.com/post/BuildyourownCommandLinewithANSIescapecodes.html#8-colors
ESC = char(27);
[ESC '[31mA' ESC '[32mB' ESC '[33mC' ESC '[30m']
You would not be able to control error color: you would have to deliberately switch color each time you wanted to.
http://undocumentedmatlab.com has some grotty details on customizing prompts, but I do not recall at the moment whether that only works in desktop mode or not.
0 Kommentare
Erez
am 18 Jun. 2018
If you would like errors to print out in a different color take a look at the following link (I can confirm it works well in Ubuntu 16.04 with R2018a, should work with other distros too). stderr in different color. This will change the std error color for anything in terminal to be red (not just matlab).I'm not sure what you can do for warning colors though.
0 Kommentare
Prakhar Rai
am 29 Jun. 2021
There are some options in the Environment section,but only dip is that it'll be same in both editor and command window.Also the standard one is pretty good,so just stay minimal.
Find the documentation: https://in.mathworks.com/help/matlab/matlab_env/color-settings.html
0 Kommentare
Siehe auch
Kategorien
Mehr zu Environment and Settings finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!