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.
set path of the external matlab function
Posted 26 mars 2013, 13:02 UTC−4 Interfacing Version 4.3a 1 Reply
Please login with a confirmed email address before reporting spam
Hello all,
I am trying to run a Matlab script of my model which in turn uses an external Matlab function. When I run the model from matlab, comsol opens a new Matlab process and tries to call the function. the problem is I am not able to explicitly specify the path of the function being called.
I did add the function's path to Matlab path, but it somehow does not get updated in the new process that comsol opens internally.
Going through Java API documentation, I found that it is possible to set the path of the function using
model.func.create('extm1', 'MATLAB');
model.func('extm1').set('funcs',{<functionname>,<argslist>});
model.func('extm1').set('manpath',<path>)
This however, does not seem to work from Matlab. Any ideas, suggestions?
Also, when I copied the function in Matlab's default path (/home/user/Documents/MATLAB), the script works just fine, it only doesnt work when the path is not default
I am trying to run a Matlab script of my model which in turn uses an external Matlab function. When I run the model from matlab, comsol opens a new Matlab process and tries to call the function. the problem is I am not able to explicitly specify the path of the function being called.
I did add the function's path to Matlab path, but it somehow does not get updated in the new process that comsol opens internally.
Going through Java API documentation, I found that it is possible to set the path of the function using
model.func.create('extm1', 'MATLAB');
model.func('extm1').set('funcs',{<functionname>,<argslist>});
model.func('extm1').set('manpath',<path>)
This however, does not seem to work from Matlab. Any ideas, suggestions?
Also, when I copied the function in Matlab's default path (/home/user/Documents/MATLAB), the script works just fine, it only doesnt work when the path is not default
1 Reply Last Post 27 mars 2013, 04:07 UTC−4