This section introduces the usage of embedded scripting step-by-step. We will begin in section Project Setup with a definition of a test project, where all input data are still fixed by the .jcm files. In the following sections we show how embedded scripting will help you to define parameterized projects in an intuitive manner.

The archive MatlabInterface.zip contains all tutorial examples in sub-folders accordingly to the subsections of this tutorial (Project Setup, Keyword Substitution, etc).

To run a project, start Matlab from the respective project directory and call the run.m script after adding JCMsuite’s Matlab interface to the search path (see Getting Started):

% jcm_root = <JCMROOT> % -> enter your JCMROOT installation directory
jcm_root = getenv('JCMROOT'); % -> get JCMROOT from environmental variable
addpath(fullfile(jcm_root, 'ThirdPartySupport', 'Matlab'));


Besides run.m, you will find a script run_geo.m in some of the project folders. This script will only generate the mesh file grid.jcm and visualize it, instead of solving the entire project.

Alternatively, you may use the script demo.m (demo_geo.m) placed in the root Tutorial folder which will ask you which problem to solve. This script automatically initializes JCMsuite provided that the environmental variable JCMROOT is set (e.g., on Windows). If this is not the case, the user is prompted to enter the JCMsuite installation path manually.