Checked out Comsol`s website. It says- "For more advanced customization, there are also a number of different Application Programming Interfaces (APIs) available to extend your modeling. The COMSOL® API for use with Java® is included with COMSOL Multiphysics® and provides a programmatic way to manipulate and drive the software through compiled object-oriented code. Alternatively, LiveLink™ for MATLAB® allows you to work with COMSOL Multiphysics® in combination with the MATLAB® technical computing language. Getting started with the COMSOL® API for use with Java® and LiveLink™ for MATLAB® is almost immediate, as you can easily save a model that has been set up in COMSOL Desktop® to the Java® or MATLAB® file formats, respectively."