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.

Error when using Livelink for Matlab

Please login with a confirmed email address before reporting spam

Hi

I need to call a Matlab function and it works fine if i try it in the simple Matlab Command Window, but when i run the simulation and try to pass probe values to the function (I use it as objective function in the optimisation module) there is an error message: "Error in sweep. Error. Unbalanced or unexpected paranthesis or bracket."

I think it is very strange because the function works in Matlab and in the Matlab command window that Comsol opens up.

Br Rasmus

2 Replies Last Post 21 giu 2016, 05:39 GMT-4

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 20 giu 2016, 12:18 GMT-4
Is there a a maximum number of variables i can pass to the matlab function? I need to pass a lot of coordinates and i couldn't find another way than to make each x-, y- and z-coordinate individual inputs.
Is there a a maximum number of variables i can pass to the matlab function? I need to pass a lot of coordinates and i couldn't find another way than to make each x-, y- and z-coordinate individual inputs.

Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 21 giu 2016, 05:39 GMT-4
Hi Rasmus

Comsol 5.2a doesn't have any limits imposed on how many arguments you can have to Matlab function called by Comsol. Previous versions had a limit around 25.

You can send your model to support@comsol.dk and someone can have a look at the problem.

--
Lars Gregersen
Comsol Denmark



Is there a a maximum number of variables i can pass to the matlab function? I need to pass a lot of coordinates and i couldn't find another way than to make each x-, y- and z-coordinate individual inputs.




Hi Rasmus Comsol 5.2a doesn't have any limits imposed on how many arguments you can have to Matlab function called by Comsol. Previous versions had a limit around 25. You can send your model to support@comsol.dk and someone can have a look at the problem. -- Lars Gregersen Comsol Denmark [QUOTE] Is there a a maximum number of variables i can pass to the matlab function? I need to pass a lot of coordinates and i couldn't find another way than to make each x-, y- and z-coordinate individual inputs. [/QUOTE]

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.