% Example demonstrating batch operation of a script driven % COMSOL Multiphysics model. Place this file % in your working directory and give the command comsol batch myscript % Solve the Poisson equation on the unit circle union with unit % rectangle, using second order lagrange elements clear fem fem.geom = circ2+rect2; fem.mesh = meshinit(fem); fem.shape = 2; fem.equ.c = 1; fem.equ.f = 1; fem.bnd.h = 1; fem.xmesh = meshextend(fem); fem.sol = femlin(fem); %Save the result in a binary file. Use flsave for COMSOL fem-structures %and save for all other data. flsave pois fem %A simple linear algebra operation a=rand(4); b=a'*a; %Save the b matrix. save bmatrex b;