This MATLAB package makes it easy to change the color scheme (a.k.a. theme) ofthe MATLAB display and GUI.
You can use Schemer to import a predefined color scheme, transfer your colorsettings between installations, or create your own color scheme.
A collection of color schemes is available in the schemes folder.Samples of these can be seen in schemes/README.md,and browsed in the folder schemes/screenshots.This is a static subtree copy of the contents of the repositorymatlab-schemes.
Color schemes can be easily imported by running schemer_import
at the MATLABcommand prompt, without needing any inputs. This will open a GUI to select thefile to import the color scheme from.
When importing a color scheme, most of the settings will change immediately.However, some settings will require MATLAB to be restarted:
For more details, see the documentation on the function schemer_import
,available with help schemer_import
.
If you are using a personalised color scheme in MATLAB, you may wish to saveit for yourself so you can re-implement it easily if you reintall MATLAB.Or you may wish to transfer your personalised color scheme from one machineto another. This section describes the steps relevant in either scenario.
On the source machine, run schemer_export
to save a temporary color schemefile, and then transfer this file to the destination machine.
When importing the new color scheme, instead of running schemer_import
withoutany inputs, you should run schemer_import(true)
. This passes a flag to tellthe function to not only import the colour preferences, but to also import yourboolean settings (such as whether to highlight the current cell/line, etc)from the file you exported from the source installation.
Should you wish to revert to the set of colours which MATLAB ships with, youshould run schemer_import('schemes/default.prf')
.
This will import the MATLAB default theme from the stylesheet default.prf
which comes as part of Schemer.
To restore the out-of-the-box state for boolean settings (such as whether tohighlight the current line) in addition to the colours, runschemer_import('schemes/default.prf', true)
.
You may be tempted to instead revert the colours by clicking theRestore Default Colors
buttons in the Color
pane of the MATLAB preferences.However, this will be less effective than importing the default colours throughSchemer because these buttons will not reset all the MATLAB colour preferences.(There is no reset button for the Editor display preferences pane, nor for theother language syntax supported by MATLAB, which is available in the EditorLanguages panel.)
When creating a color scheme to share with the rest of the world, it isrecommended to ensure colours are chosen appropriately for all possiblesettings, even if they are not enabled.
For example, if you are creating a dark colour scheme, you may have cellhighlighting disabled but it would still be ill-advised to leave the backgroundhighlight colour for cell displays as the default pale beige because other usersmay have this setting enabled.
If you have made a custom color scheme using the MATLAB GUI to pick the colours,you can export the new color scheme with schemer_export
.
Please note, this requires you to have visited all relevant panes of thePreferences window at least once since MATLAB was installed, even if thesettings have not been changed from the default.See the help for schemer_export
for more details.
If you are converting a color scheme designed for another editor into a MATLABstylesheet, you may find it easier to start with a duplicate of the templatestylesheet develop/template_scheme.prf and copythe colours into this.
To understand which colour settings the parameter names correspond to, you canrefer to the annotated screenshot,develop/annotated_default.png.
The values for each colour in the .prf stylesheet must be recorded as singleRGB integers, with each colour channel in 8-bit (0-255), R as big endian,and a opaque alpha channel. Because the format for RGB colours in Java allowsfor an alpha channel and the integers are signed, all the colours you recordin your .prf file should be negative, spanning the range-16777216
(black, [0,0,0]
) to -1
(white, [255,255,255]
).
The text file for your pre-existing theme will typically specify its colous inhexadecimal format, or in terms of R, G, B values. You will needto convert the colours from this format into the format which MATLAB preferencefiles use to specify colours instead.The Schemer package comes with a utility functiondevelop/color2javaRGBint.mto help make this easier. See the color2javaRGBint
documentation for moredetails.
MATLAB supports syntax highlighting for several languanges in addition to its own.Currently these languages areMuPAD, TLC, VRML, C/C++, Java, VHDL, Verilog, and XML/HTML.The colours used for the syntax highlighting of all these languages can be setin the Languages subpanel of the Editor/Debugger pane in the Preferences window.
Typically, one will want to make a color scheme which has colours in theselanguages which match the colours of the analogous MATLAB syntax.By default, this is the behaviour which Schemer will perform.
Without specifying any inputs to schemer_export
, an exported color scheme filewill contain only the colours used for MATLAB syntax highlighting and no otherlanguages, since it is expected that users will typically not set the coloursfor any of these languages. When this is loaded with schemer_import
, the missingcolours for additional languages are automatically completed based on the MATLABsyntax.
If you do customise the colours for the additional language syntax highlighting,you can export this by setting an appropriate flag, such as schemer_export(3)
.For more details, see the schemer_export
documentation.
If you are designing a color scheme and are very detail-oriented, you may like todo the following.
schemer_export('tmp.prf',1)
, excluding additionallanguage syntax from the export.schemer_import('tmp.prf')
, which overwrites thesyntax for the additional languages with automatically inferred colours.schemer_export(3)
to includethe customised colours for the additional languages.If you are particularly proud of your new color scheme (and why wouldn't you be)and would like to to share it with the world as part of the matlab-schemer
package, this is possible!
Please head over to our daughter repository, matlab-schemes, which holds themaster copy of the color schemes issued here as part of Schemer in the schemesdirectory.
If you fork matlab-schemes, add your .prf
file and issue a pull request,the new scheme will be reviewed and added to the repository.This content is then mirrored here using git subtree
. For more details, seeour CONTRIBUTING.md.
Please note that Schemer requires MATLAB to be run with Java support enabled.
For details on how the method was implemented, seethis Undocumented Matlab article.
背景 将修改内容添加到matlab的matlab.prf文件中,文件路径为在matlab中运行prefdir的结果,直接添加这些内容保存就好。 github主题制作地址,里面有多种matlab主题配色,参考github效果: https://github.com/scottclowe/matlab-schemer/tree/master/schemes 操作 1、matlab的命令窗口中输入pre
是否有一种方法(可能没有文档?)为MATLAB编辑器导入/导出颜色主题? 举个例子,我想在MATLAB中导入Zenburn颜色方案。 当我试图在我的MATLAB安装之间移动我自己定制的主题时,我对MATLAB中缺少配色方案/主题导入和导出工具感到非常恼火,我去制作了一个这样做的包。 最终结果称为MATLAB Schemer,相当全面。除了Alexandre Chabot的帖子中描述的主要颜色外,它
1 matlab背景和高亮美化 1.1 下载一个GitHub项目 scottclowe/matlab-schemer 先别管这是啥,全部下载下来。 1.2 这个项目中有的样式 https://github.com/scottclowe/matlab-schemer/tree/master/schemes 在这个文件夹中的readme里,展示了他这个项目中所包含的样式,个人推荐monokai.prf
MATLAB是矩阵实验室(Matrix Laboratory)的简称,是美国MathWorks公司出品的商业数学软件,用于算法开发、数据可视化、数据 分析以及数值计算的高级技术计算语言和交互式环境,主要包括MATLAB和Simulink两大部分。 MATLAB和Mathematica、Maple并 称为三大数学软件。它在数学类科技应用软件中在数值计算方面首屈一指。MATLAB可以进行矩阵运算、绘
MATLAB code for reading and writing CIFTI files, v2 This library is compatible with the CIFTI-2 format, withoutexternally installed dependencies (except that CIFTI-1 files requirewb_command for conver
Zaf-Matlab Zafar's Audio Functions in Matlab for audio signal analysis. Files: zaf.m: Matlab class with the audio functions. examples.ipynb: Jupyter notebook with some examples. audio_file.wav: audio
BIDS for MATLAB / Octave This repository aims at centralising MATLAB/Octave tools to interact with datasets conforming to the BIDS (Brain Imaging Data Structure) format. For more information about BID
REPET-Matlab REPeating Pattern Extraction Technique (REPET) in Matlab for audio source separation. Repetition is a fundamental element in generating and perceiving structure. In audio, mixtures are of
snopt-matlab (version 3.0) This is version 3.0 of the Matlab interface for sparse nonlinear optimization software SNOPT. Requires the SNOPT software package. Changes from version 2.5: all-in-one calls
JIGSAW: An unstructured mesh generator JIGSAW is an unstructured mesh generator and tessellation library; designed to generate high-quality triangulations and polyhedral decompositions of general plan
VFIToolkit-matlab A Matlab Toolkit for Macroeconomic Models using Value Function Iteration Website: vfitoolkit.com Documentation, Examples, Instructions on Getting Started, and more are all on the web