matlab.general Settings
R2026bGeneral settings including MAT-file and random number settings
You can customize MATLAB® using the matlab.general settings. Access
matlab.general settings using the root
SettingsGroup object returned by the settings
function. For example, set the temporary value for the MAT-file save format to
"v7.3" (where the default is
"v7").
s = settings;
s.matlab.general.matfile.SaveFormat.TemporaryValue = "v7.3"For more information about settings, see Access and Modify Settings Programmatically.
matlab.general.matfile
MAT-File version to save MAT-files to, specified as
"v7.3", "v7", or
"v6".
For more information about MAT-file versions, see MAT File Versions.
Example: s.matlab.general.matfile.SaveFormat.TemporaryValue =
"v7.3"
Enable compression by default, specified as a numeric or logical
1 (true) or 0
(false). Specify true to turn on
compression by default or false to turn off compression
by default. You can use this setting with MAT-File versions 7 and
7.3.
Example: s.matlab.general.matfile.EnableCompression.TemporaryValue
= true
matlab.general.randomnumbers
Since R2023b
Default algorithm for random number generation, specified as
"twister", "combRecursive",
"multFibonacci", "pcg" (since R2026b), "philox",
"simdTwister", "threefry", or
"xoshiro" (since R2026b).
For more information about random number generation, see rng.
Example: s.matlab.general.randomnumbers.DefaultAlgorithm.PersonalValue
= "threefry"
Since R2023b
Default seed used for random number generation, specified as a nonnegative
integer less than 2^32.
Example: s.matlab.general.randomnumbers.DefaultSeed.PersonalValue
= 3
matlab.general.windows
Since R2023b
Option to automatically collapse windows in MATLAB
Online, specified as a numeric or logical 1
(true) or 0 (false).
Collapsed windows are reduced to their title bars.
![]()
By default, when you click the MATLAB background, open windows in the foreground collapse. To restore the collapsed windows, click one of the previously open windows.
Specify false to disable the automatic collapse.
Example: s.matlab.general.windows.AutoCollapse.PersonalValue =
false
Version History
Introduced in R2018aWhen you change the default algorithm for random number generation, you can now
specify two additional algorithms: "pcg" and
"xoshiro". Alternatively, you can set either generator as the
default by specifying it in the MATLAB Settings Window.
To access and modify the default algorithm and seed for the random number
generator programmatically, you can access the
matlab.general.randomnumbers settings using the root
SettingsGroup object returned by the settings
function. For example, show the default algorithm and change the default seed for the random
number generator.
s = settings; s.matlab.general.randomnumbers.DefaultAlgorithm s.matlab.general.randomnumbers.DefaultSeed.PersonalValue = 5
When you first start a MATLAB session or call rng("default"), MATLAB initializes the random number generator using the default algorithm
and seed that you have set. If you do not change these settings, then MATLAB uses the factory value of "twister" for the
Mersenne Twister generator with seed 0, as in previous releases.
Alternatively, you can change the default algorithm and seed for the random number
generator from the MATLAB
Settings Window. On the Home tab, in
the Environment section, click
Settings. Select MATLAB > General, and then select a different option for Default
algorithm and select a different value for Default seed in the Random Number
Generation setting.
By default, when you click the MATLAB background, open windows in the foreground collapse. To restore the collapsed windows, click one of the previously open windows.
To modify the setting that determines whether the windows collapse, access the
matlab.general.windows settings using the root
SettingsGroup object returned by the
settings function. Then, access or modify the
AutoCollapse setting. For example, disable the automatic
collapse.
s = settings; s.matlab.general.windows.AutoCollapse.PersonalValue = false
Alternatively, disable the automatic collapse from the MATLAB
Settings Window. On the Home tab, in
the Environment section, click
Settings. Select MATLAB > General > Collapsible Windows. Then, clear the Enable Auto-Collapse
setting.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)