|
|
MATLAB interface: Introduction |
The MATLAB OrcaFlex interface is a set of M-files and a MATLAB Mex file that provide access to the OrcaFlex API from within the MATLAB environment. The MATLAB OrcaFlex interface offers the same features and advantages over the C API as does the Python OrcaFlex interface, see the Python introduction for more information.
The MATLAB interface uses similar syntax and usage patterns as the Python interface but there are some differences, the main ones are:
The following example script adds a line to an empty model, sets its length, runs and saves the simulation, and then displays the maximum effective tension values occurring during the simulation:
model = ofxModel; % Create a new model
line = model.CreateObject(ofx.otLine, 'MyLine'); % Create a line and give it a name
line.Length(1) = 125.0; % Set the length of the first section
model.RunSimulation;
model.SaveSimulation('Test.sim');
rangeResults = line.RangeGraph('Effective Tension');
rangeResults.Max % display the range graph maximum values
See MATLAB interface: Example for a more comprehensive example.