About Compact Notation
This example uses compact notation to shorten the commands that are entered at the MATLAB command line. The compact notation uses MATLAB variables as links to provide direct access to COMSOL model object features.
For example, to create a block using the compact notation, enter:
blk = geom.feature.create('blk1', 'Block');
blk.setIndex('size', '2', 0);
blk.setIndex('size', '3', 1);
This creates a block, then changes its width to 2 and its depth to 3.
Compared to above, the commands using a full notation are:
geom.feature.create('blk1', 'Block');
geom.feature('blk1').setIndex('size', '2', 0);
geom.feature('blk1').setIndex('size', '3', 1);
When a model object is saved in the M-file format, the full notation is always used.
Note: 'blk1' is the block geometry tag defined inside the COMSOL model object. The variable blk, defined only in MATLAB, is the link to the block feature. By linking MATLAB variables to features, you can directly access and modify features of a COMSOL model object in an efficient manner.