Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.
COMSOL–MATLAB Livelink Export Issue
Posted 03.06.2025, 06:08 GMT-4 Heat Transfer, LiveLink for MATLAB 1 Reply
Please login with a confirmed email address before reporting spam
Dear all,
I am using the student version of COMSOL Multiphysics 6.3 and am encountering some issues when trying to run a COMSOL model exported as a .m file in MATLAB.
Specifically, the model (which includes heat transfer and surface-to-surface radiation in a 3D geometry) runs perfectly within COMSOL. However, when I export it as a .m file and attempt to run it in MATLAB, I encounter an error during the physics definition step, particularly when boundary selections are being set.
The error suggests that some of the boundary indices being referenced do not exist.
Java exception occurred: Exception:
com.comsol.util.exceptions.UnexpectedServerException: com.comsol.model.data.SelectionOutOfBoundsException: Illegal input vector illegal entity
number
(rethrown as com.comsol.util.exceptions.FlException)
Messages:
com.comsol.model.data.SelectionOutOfBoundsException: Illegal input vector illegal entity number
This is the incriminated matlab line that gives error but in realty this happen for any selection boundary in the code:
model.component('comp1').physics('ht').feature('hf1').selection.set([41 42 46 49 50 51 53 54 56 57 66 67 68 69 71 72 74 75 83 84 89 90 107 110 127 128 130 131 133 134 141 142 148 149 150 153]);
However, I am unable to understand what is causing the issue, as the model runs flawlessly within COMSOL. The selection indices appear to match those used in the COMSOL model and therefore should exists.
Thank you in advance to anyone who might be able to help.
Best regards, Federico
Hello Federico Torre
Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.
If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.
