comsol计算数据导出matlab,comsol4.2怎样在matlab中通过函数输出数据
急!comsol4.2怎樣在matlab中運行輸出數據,怎樣通過mpheval等函數讀取comsol4.2計算結果。
運行以下代碼老是報錯:Corrupt P-file "...\COMSOL42\mli\mphplot.p"
import com.comsol.model.*
import com.comsol.model.util.*
model = ModelUtil.create('Model');
model = ModelUtil.create('Model');
% Create the geometry
model.geom.create('geom1', 2);
model.geom('geom1').feature.create('sq1', 'Square');
model.geom('geom1').run;
% Create the mesh
model.mesh.create('mesh1', 'geom1');
model.mesh('mesh1').feature.create('fre1', 'FreeTri');
model.mesh('mesh1').run;
model.mesh('mesh1')
% Setup physics
es=model.physics.create('es', 'Electrostatics', 'geom1');
es.feature('ccn1').set('epsilonr_mat', 1, 'userdef');
es.feature.create('gnd1', 'Ground', 1);
es.feature('gnd1').selection.set([2]);
es.feature.create('sfcd1', 'SurfaceChargeDensity', 1);
es.feature('sfcd1').selection.set([4]);
es.feature('sfcd1').set('rhoqs', 1, '1e-10');
%Create the study
model.study.create('std1');
model.study('std1').feature.create('stat1', 'Stationary');
model.study('std1').run;
% Create a plot group
model.result.create('pg1', 2);
model.result('pg1').set('data', 'dset1');
model.result('pg1').feature.create('surf1', 'Surface');
mphplot(model,'pg1');
figure(2);
mphmesh(model,'mesh1');
總結
以上是生活随笔為你收集整理的comsol计算数据导出matlab,comsol4.2怎样在matlab中通过函数输出数据的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java time 周期性执行,详解Sc
- 下一篇: matlab绘制三维图形现状,MATLA