Clear Filters
Clear Filters

Start matlab from terminal

10 views (last 30 days)
Clement
Clement on 23 Jul 2022
Answered: Nivedita on 8 Sep 2023
System OS: macOS Monterey
Mackbook Pro (13-inch, M1, 2020); Memory: 16GB;
MATLAB version: R2021b
Whenever I type in terminal
> alias matlab="/Applications/MATLAB_R2021b.app/bin/matlab"
> matlab -nodesktop
it will work (I can run 'clc' and everything works fine), but it will produce the following output
2022-07-23 06:26:01.830 MATLAB_maci64[84022:3201614] CoreText note: Client requested name ".HelveticaNeueDeskInterface-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-07-23 06:26:01.830 MATLAB_maci64[84022:3201614] CoreText note: Set a breakpoint on CTFontLogSystemFontNameRequest to debug.
2022-07-23 06:26:01.911 MATLAB_maci64[84022:3201614] CoreText note: Client requested name ".HelveticaNeueDeskInterface-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2022-07-23 06:26:01.911 MATLAB_maci64[84022:3201614] CoreText note: Client requested name ".HelveticaNeueDeskInterface-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
which is just annoying. Is there a way to get rid of these outputs?

Answers (1)

Nivedita
Nivedita on 8 Sep 2023
Hi Clement,
I understand that you want to get rid of the warning messages that are displayed generated by “CoreText”.
These outputs are notes or warnings generated by CoreText, a text layout and rendering engine used by macOS. These notes indicate that MATLAB is requesting a specific font name (".HelveticaNeueDeskInterface-Regular") that is not available, and as a fallback, the system is providing a different font (Times-Roman) instead. They are typically harmless and do not affect the functionality of MATLAB.
To get rid of the “CoreText” warnings while running MATLAB in the Terminal on macOS Monterey redirect the specific warning messages to /dev/null. Here's how you can do it:
  • Modify the “alias” command that you are using to redirect only the CoreText warnings to /dev/null in this way:
alias matlab="(/Applications/MATLAB_R2021b.app/bin/matlab 2>&1 | grep -v 'CoreText' >&2)"
  • This modified command does the following:
2>&1: Redirects stderr (standard error) to stdout (standard output).
| grep -v 'CoreText': Pipes the output to grep and uses the -v flag to exclude lines containing the word "CoreText".
>&2: Redirects the filtered output back to stderr.
  • Finally, execute the “matlab -nodesktop” command on Terminal to start MATLAB without the “CoreText” warnings. The “CoreText” warnings will no longer displayed in the Terminal while running MATLAB.
Please note that this approach filters out lines containing the word "CoreText" from the output. If there are other lines you want to exclude, you can modify the "grep" command accordingly. Keep in mind that this method redirects specific warnings while still allowing other errors and output to be displayed.
I hope this helps!
Regards,
Nivedita.

Categories

Find more on Environment and Settings in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!