CAWT 2.4.7 Reference Manual

# ::MatlabMain

The `Matlab` namespace provides commands to control MathWorks Matlab.

## CommandsMatlab, Main

#### ExecCmd [::Matlab]Matlab, Main

Execute a Matlab command.

ExecCmd appId cmd

`appId` | Identifier of the Matlab instance.
`cmd` | String containing the Matlab command being executed.

Returns the Matlab answer as a string.

Show source

    proc ::Matlab::ExecCmd {appId cmd} {

        # Execute a Matlab command.
        #
        # appId - Identifier of the Matlab instance.
        # cmd   - String containing the Matlab command being executed.
        #
        # Returns the Matlab answer as a string.

        set retVal [$appId Execute $cmd]
        return $retVal
    }

#### Open [::Matlab]Matlab, Main

Open a Matlab instance.

Open ?visible?

`visible` | If set to true, show the application window. Otherwise hide the application window. Optional, default `true`.

Use an already running instance, if available.

Returns the identifier of the Matlab application instance.

See also: OpenNew, Visible, Quit

Show source

    proc ::Matlab::Open {{visible true}} {

        # Open a Matlab instance.
        #
        # visible - If set to true, show the application window.
        #           Otherwise hide the application window.
        #
        # Use an already running instance, if available.
        #
        # Returns the identifier of the Matlab application instance.
        #
        # See also: OpenNew Visible Quit

        variable matlabAppName

        set appId [Cawt GetOrCreateApp $matlabAppName true]
        Matlab Visible $appId $visible
        return $appId
    }

#### OpenNew [::Matlab]Matlab, Main

Open a new Matlab instance.

OpenNew ?visible?

`visible` | If set to true, show the application window. Otherwise hide the application window. Optional, default `true`.

Returns the identifier of the new Matlab application instance.

See also: Open, Visible, Quit

Show source

    proc ::Matlab::OpenNew {{visible true}} {

        # Open a new Matlab instance.
        #
        # visible - If set to true, show the application window.
        #           Otherwise hide the application window.
        #
        # Returns the identifier of the new Matlab application instance.
        #
        # See also: Open Visible Quit

        variable matlabAppName

        set appId [Cawt GetOrCreateApp $matlabAppName false]
        Matlab Visible $appId $visible
        return $appId
    }

#### Quit [::Matlab]Matlab, Main

Quit a Matlab instance.

Quit appId

`appId` | Identifier of the Matlab instance.

Returns no value.

See also: Open

Show source

    proc ::Matlab::Quit {appId} {

        # Quit a Matlab instance.
        #
        # appId - Identifier of the Matlab instance.
        #
        # Returns no value.
        #
        # See also: Open

        $appId Quit
    }

#### Visible [::Matlab]Matlab, Main

Toggle the visibility of a Matlab application window.

Visible appId visible

`appId` | Identifier of the Matlab instance.
`visible` | If set to true, show the application window. Otherwise hide the application window.

Returns no value.

See also: Open, OpenNew

Show source

    proc ::Matlab::Visible {appId visible} {

        # Toggle the visibility of a Matlab application window.
        #
        # appId   - Identifier of the Matlab instance.
        # visible - If set to true, show the application window.
        #           Otherwise hide the application window.
        #
        # Returns no value.
        #
        # See also: Open OpenNew

        $appId Visible [Cawt TclInt $visible]
    }

# Start page

# Cawt

# Office

# Excel

# Ppt

# Word

# Outlook

# OneNote

# Office::Enum

# Excel::Enum

# Ppt::Enum

# Word::Enum

# Outlook::Enum

# OneNote::Enum

# Earth

# Explorer

# Ocr

# Reader

# Matlab

## Commands

#### ExecCmd Execute a Matlab command.

#### Open Open a Matlab instance.

#### OpenNew Open a new Matlab instance.

#### Quit Quit a Matlab instance.

#### Visible Toggle the visibility of a Matlab application window.

Document generated by Ruff!