Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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.

Matlab function

Please login with a confirmed email address before reporting spam

Hello,
I have a problem with importing matlab-functions in comsol (version 4.3b in Linux). After I have inserted the function name, variables and the range, I get the following error-message: "Matlab function is not found: ..." (see attached file). Maybe the path to the matlab-functions is wrong, can you please help me with this?


3 Replies Last Post Apr 7, 2014, 3:58 a.m. EDT
COMSOL Moderator

Hello Matthias Ernst

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.


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 4, 2014, 4:23 a.m. EDT
Hello Matthias,
I am having exactly the same problem, but with version 4.3a in Windows.
What is more exasperating is that at the same time, I open the example model "vacuum_flask_llmatlab.mph", I define the functions in Matlab as the pdf file expains and it works fine.
When I define a Matlab function in the model I'm working on and define the function in Matlab exactly in the same way I did with the example, I get the error message you are reporting.
Have you had any luck by now?
Hello Matthias, I am having exactly the same problem, but with version 4.3a in Windows. What is more exasperating is that at the same time, I open the example model "vacuum_flask_llmatlab.mph", I define the functions in Matlab as the pdf file expains and it works fine. When I define a Matlab function in the model I'm working on and define the function in Matlab exactly in the same way I did with the example, I get the error message you are reporting. Have you had any luck by now?

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 4, 2014, 7:14 a.m. EDT
Hello Jesus,
now it works. It is very important, that you have saved your Comsol-model in the same path as your Matlab-function, befor you import the Matlab-function to your Comsol-model.
Hello Jesus, now it works. It is very important, that you have saved your Comsol-model in the same path as your Matlab-function, befor you import the Matlab-function to your Comsol-model.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 7, 2014, 3:58 a.m. EDT
Hi Matthias,
Thank you for answering so fast.
I don't know why, but suddenly it started working. I am really not aware of having made any change for this to happen, but it works now.
It makes sense what you say. It is easier to put the files in the same path; however, it seems that this is not really necessary. What is necessary is that Matlab can find your file's function, and this can also be achieved by including in Matlab the path where you put the Matlab files that you work on, no matter where your Comsol file is located. This path can either be Matlab's default or any other you use.
Hi Matthias, Thank you for answering so fast. I don't know why, but suddenly it started working. I am really not aware of having made any change for this to happen, but it works now. It makes sense what you say. It is easier to put the files in the same path; however, it seems that this is not really necessary. What is necessary is that Matlab can find your file's function, and this can also be achieved by including in Matlab the path where you put the Matlab files that you work on, no matter where your Comsol file is located. This path can either be Matlab's default or any other you use.

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.