mphload
Load a COMSOL Multiphysics model MPH-file.
Syntax
model = mphload(filename)
model = mphload(filename, mtag)
model = mphload(filename, mtag, '-history')
model = mphload(filename, mtag, pwd)
[model, filename] = mphload(filename, ...)
Description
model = mphload(filename) loads a COMSOL model object saved with the name filename and assigns the default tag Model in the COMSOL server. If a model with tag Model already exists and is also open in a COMSOL Multiphysics client, the loaded model an index number is appended to the tag, for instance Model1. The model object is accessible at the MATLAB prompt using the variable model.
model = mphload(filename, mtag) loads a COMSOL model object and assigns the tag mtag in the COMSOL server.
model = mphload(filename, mtag, '-history') turns on model history recording.
model = mphload(filename, mtag, pwd) loads the COMSOL model object saved with the name filename protected with the password pwd.
model = mphload(mtag) link the model already loaded on the COMSOL server with the tag mtag. The model object is accessible at the MATLAB prompt using the variable model.
[model, filenameloaded] = mphload(filename, ...) also returns the full file name filenameloaded of the file that was loaded.
The model tag mtag and the password pwd are defined as string.
If the model tag is the same as a model that is currently in the COMSOL server the loaded model overwrites the existing one.
Note that MATLAB® searches for the model on the MATLAB path if an absolute path is not supplied.
mphload turns off the model history recording by default, unless the property '-history' is used.
The extension mph can be omitted.
mphload does not look for lock file when opening a model in the COMSOL server.
Example
Load the file model_tutorial_llmatlab.mph:
model = mphload('model_tutorial_llmatlab');
Load the file model_tutorial_llmatlab.mph and set the model name in the COMSOL server to Model2:
model = mphload('model_tutorial_llmatlab','Model2');
Load model_tutorial_llmatlab.mph and return the filename:
[model, filename] = mphload('model_tutorial_llmatlab');
See also
mphopen, mphsave