Java class that calls a Matlab function

Please login with a confirmed email address before reporting spam

Hi,

I am coding my Comsol simulation in Java. This simulation calls a Matlab function. Additionally, my Java class reads parameters from a text file called 'input.dat'. So I wanted to run this simulation from the terminal with the following command:

comsolbatch -inputfile PiezoLattice.class input.dat

However, I always get the error of not finding the Matlab file. I have placed it in the same folder of the Java class and the Matlab folder, but in both cases I get the same error. I thought in using the command 'comsolmphserver matlab', but for that I need to use a Matlab file.

So, is it possible to have my Comsol simulation that calls a Matlab function in a Java class ?


0 Replies Last Post 15 ago 2025, 19:51 GMT-4
COMSOL Moderator

Hello Angel Mora

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.

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.