メインコンテンツ

renameSecret

Change name of secret in MATLAB vault

Since R2026a

Description

renameSecret(oldsecretname,newsecretname) changes the name of an existing secret in your MATLAB® vault from oldsecretname to newsecretname.

example

Examples

collapse all

Rename a secret in your MATLAB vault.

renameSecret(oldsecretname,newsecretname);

Rename multiple secrets in your MATLAB vault.

wrongNames = ["wrongname2","wrongname3"];
correctNames = ["correctname2","correctname3"];
for i = 1 : wrongNames.length
    renameSecret(wrongNames(i),correctNames(i));
end

Input Arguments

collapse all

Text identifier for an existing secret, specified as a string scalar or character vector.

New text identifier for the secret, specified as a string scalar or character vector. If you specify the name of an existing secret, the renameSecret function returns an error.

More About

collapse all

Extended Capabilities

expand all

Version History

Introduced in R2026a