Contenu principal

Commandes système

Interagir de manière programmatique avec le système d’exploitation et l’environnement MATLAB®

Les commandes système vous offrent un accès programmatique à votre système d’exploitation et à l’environnement MATLAB. Vous pouvez les utiliser pour accéder à des informations concernant votre ordinateur, copier le contenu dans le presse-papiers du système, obtenir et définir des variables d’environnement et exécuter des commandes du système d’exploitation. Pour consulter et modifier les options des outils MATLAB tels que la fenêtre de commande, l’éditeur ou App Designer, utilisez les paramètres. Pour stocker vos propres données et y accéder dans différentes sessions MATLAB, créez des paramètres personnalisés.

Fonctions

développer tout

clipboardCopy and paste text to and from system clipboard
computerInformation about computer on which MATLAB is running
systemExecute operating system command and return output
cmdsepCommand separator for current platform (depuis R2023b)
dosExecute DOS command and return output
unixExecute UNIX command and return output
getenvGet environment variable
loadenvLoad environment variables from .env and plain text files (depuis R2023a)
isenvDetermine if environment variable exists (depuis R2022b)
setenvSet environment variable
unsetenvRemove environment variable (depuis R2022b)
perlCall Perl script using operating system executable
winqueryregItem from Windows registry
matlabProcessIDProcess identifier for MATLAB code execution process (depuis R2025a)
matlab.io.saveVariablesToScriptSave workspace variables to MATLAB script
getprefGet custom setting value
setprefSet custom setting value
addprefAdd custom setting
rmprefRemove custom preference
isprefDetermine if custom setting exists

Accéder aux paramètres et les modifier

settingsAccess the SettingsGroup root object
clearTemporaryValueClear temporary value for setting
clearPersonalValueClear personal value for setting
clearInstallationValueClear installation value for setting (depuis R2022a)
hasActiveValueDetermine whether setting has active value set (depuis R2024a)
hasTemporaryValueDetermine whether setting has temporary value set
hasPersonalValueDetermine whether setting has personal value set
hasInstallationValue Determine whether setting has installation value set (depuis R2022a)
hasFactoryValueDetermine whether setting has factory value set
SettingRepresents individual setting
SettingsGroupGroup of settings and subgroup objects

Créer des paramètres

addSettingAdd new setting
addGroupAdd new settings group
hasGroupDetermine if settings group exists
hasSettingDetermine if setting exists in settings group
removeGroupRemove settings group
removeSettingRemove setting

Validation des paramètres

matlab.settings.mustBeLogicalScalarValidate that setting value is a logical scalar
matlab.settings.mustBeNumericScalarValidate that setting value is a numeric scalar
matlab.settings.mustBeStringScalarValidate that setting value is a string scalar
matlab.settings.mustBeIntegerScalarValidate that setting value is an integer scalar

Paramètres par défaut

matlab.settings.FactoryGroup.createToolboxGroupCreate FactoryGroup root object for toolbox
addGroupAdd new factory settings group
addSettingAdd new factory setting
matlab.settings.SettingsFileUpgraderVersion-specific changes in factory settings tree of toolbox
moveRecord move or rename of factory setting or group
removeRecord removal of factory setting or group
matlab.settings.reloadFactoryFileLoad or reload factory settings
matlab.settings.loadSettingsCompatibilityResultsResults of upgrading personal settings of toolbox for specific version
FactoryGroupGroup of factory settings and factory subgroup objects
FactorySettingFactory settings object
ReleaseCompatibilityResultsResults of upgrading toolbox with specific version number
ReleaseCompatibilityExceptionException that occurs when upgrading toolbox
VersionResultsResults of upgrade operations
OperationResultStatus of individual operation when upgrading toolbox

Paramètres

développer tout

matlab.accessibility SettingsAccessibility settings, including screen reader settings (depuis R2026a)
matlab.codeanalyzer SettingsCode analyzer settings
matlab.colors SettingsMATLAB syntax highlighting color settings for light theme
matlab.commandwindow SettingsCommand Window settings including text display settings
matlab.fonts SettingsCode font settings
matlab.general SettingsGeneral settings including MAT-file and random number settings
matlab.keyboard SettingsKeyboard settings including suggestions and completions settings
matlab.suggestions SettingsCode suggestions settings (depuis R2026a)
matlab.editor SettingsEditor settings, including language, backup, and display settings
matlab.appdesigner SettingsApp Designer settings, including canvas editor and component browser settings

Rubriques

Informations connexes