| Excel Link | ![]() |
Syntax
MLPutVar ML_var_name, VBA_var_name
Description
Creates or overwrites matrix ML_var_name in MATLAB workspace with data in VBA_var_name. Creates ML_var_name if it does not exist. If ML_var_name already exists, this function replaces the contents with data from VBA_var_name. VBA_var_name can contain either numeric data or string data but not both. Use MLPutVar only in a macro subroutine, not in a macro function or in a subroutine called by a function.
Example
Sub Put() MLPutVar "K", DataK End Subcreates or overwrites MATLAB matrix
K with the data in the VBA variable DataK.
See Also
MLGetVar
| MLPutMatrix | Error Messages and Troubleshooting | ![]() |