How to extract data from Layered Shell dataset to matlab

Please login with a confirmed email address before reporting spam

The mpheval and mphinterp functions fail to extract localized variables (such as r_llmat1_xdim) when querying standard evaluation datasets directly in memory. I need help on how to export this data into MATLAB. lshl1_eval = mpheval(model, {'T'}, 'dataset', 'lshl1'); 错误使用 mpheval mpheval (0): Java exception occurred: Exception: com.comsol.util.exceptions.FlException: 数据集类型无效。 Messages: 数据集类型无效。 - 标记: lshl1

lshl1_eval = mpheval(model, {'T','r','r_llmat1_xdim'}, 'dataset', 'dset1', 'selection', 3, 'edim', 1);

错误使用 mpheval mpheval (0): Java exception occurred: Exception: com.comsol.util.exceptions.FlException: 无法计算表达式。 Messages: 无法计算表达式。

未定义变量。
- 变量: r_llmat1_xdim
- 几何: geom1
- 边界: 3

无法计算表达式。
- 表达式: 1000*r_llmat1_xdim
- 特征: 计算

1 Reply Last Post 1 sept. 2026, 07:17 UTC−4
Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 2 hours ago 1 sept. 2026, 07:17 UTC−4
Updated: 1 hour ago 1 sept. 2026, 08:36 UTC−4

Hi 浩

mpheval doesn't work for extra dimensions dataset.

This should work:

dset1_eval = mpheval(model, {'T' 'r' 'z'},'dataset','dset1')

and you can add more properties to refine the extraction:

dset1_eval = mpheval(model, {'T' 'r' 'z'},'dataset','dset1','edim',1,'selection',4)

For the xtra dimensions you can use mphinterp:

[lT,lr,lrx]=mphinterp(model, {'T' 'r' 'r_llmat1_xdim'},'dataset','lshl1');

I hope this helps. If not, then please write again.

-------------------
Lars Gregersen
Comsol Denmark
Hi 浩 mpheval doesn't work for extra dimensions dataset. This should work: dset1_eval = mpheval(model, {'T' 'r' 'z'},'dataset','dset1') and you can add more properties to refine the extraction: dset1_eval = mpheval(model, {'T' 'r' 'z'},'dataset','dset1','edim',1,'selection',4) For the xtra dimensions you can use mphinterp: [lT,lr,lrx]=mphinterp(model, {'T' 'r' 'r_llmat1_xdim'},'dataset','lshl1'); I hope this helps. If not, then please write again.

Reply

Please read the discussion forum rules before posting.

Please log in to post a reply.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.