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 Mar 26, 2013, 1:02 p.m. EDT 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 Mar 27, 2013, 4:07 a.m. EDT