MATLAB interface: Installation

Requirements

The OrcaFlex interface to MATLAB requires MATLAB version R2017b or later.

Installing the MATLAB interface to OrcaFlex

The MATLAB OrcaFlex interface files are included on the OrcaFlex installation CD and are installed when OrcaFlex is installed. The MATLAB OrcaFlex interface files are installed into a folder named OrcFxAPI/MATLAB inside the OrcaFlex installation directory.

Configuration within MATLAB

The MATLAB OrcaFlex interface files should be added to the MATLAB search path in order for MATLAB to find them. This is done as follows:

addpath 'C:\Program Files (x86)\Orcina\OrcaFlex\<version>\OrcFxAPI\MATLAB'

If the files are installed in a different location on your system you will need to use the appropriate path.

This only adds the path for the current MATLAB session. To include the path for every session you must include this addpath command in a 'startup.m' file which MATLAB always runs when it is started. See the MATLAB documentation for startup.m.

Once you have added the location of the MATLAB OrcaFlex interface to the MATLAB search path you are ready to start. Create a model as a test:

model = ofxModel

This should result in the following output (the handle number will differ):

model = ofxModel

ofxModel: handle = 12345678