MLDeleteMatrix

Delete MATLAB matrix

Syntax

MLDeleteMatrix(var_name)
MLDeleteMatrix var_name
out = MLDeleteMatrix(var_name)

Description

MLDeleteMatrix(var_name) deletes the named matrix from the MATLAB® workspace. Use this syntax when working directly in a worksheet.

MLDeleteMatrix var_name deletes the named matrix from the MATLAB workspace. Use this syntax in a VBA macro.

out = MLDeleteMatrix(var_name) lets you catch errors when executing MLDeleteMatrix in a VBA macro. If MLDeleteMatrix fails, then out is a string containing error code. Otherwise, out is 0.

Input Arguments

var_name

Name of MATLAB matrix to delete.

var_name in quotes directly specifies the matrix name. var_name without quotes specifies a worksheet cell address (or range name) that contains the matrix name.

Output Arguments

out

0 if the command succeeded. Otherwise, a string containing error code.

Examples

expand all

Delete a Matrix from the MATLAB Workspace

Delete matrix A from the MATLAB workspace:

MLDeleteMatrix("A")
Was this topic helpful?