Quantcast
Channel: Latest Discussions - COMSOL Forums
Viewing all articles
Browse latest Browse all 26527

set path of the external matlab function

$
0
0
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

Viewing all articles
Browse latest Browse all 26527

Trending Articles