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 LiveLink
Posted 27 giu 2014, 14:19 GMT-4 Low-Frequency Electromagnetics, Interfacing Version 4.4 3 Replies
Please login with a confirmed email address before reporting spam
Hi!
I am trying to model a smart material called Magnetorheological Elastomers. It can change it's stiffness when a magnetic field is present. To do this, I would like to use a MATLAB function that can calculate the shear modulus based on the field present.
However, I keep running to the issue that the MATLAB directory is not setup correctly... I have gone into MATLAB and set the path directly to where all of the files are located and it still cannot run.
I am using MATLAB 2013a and COMSOL 4.4. I have the read the User Guide for MATLAB LiveLink and I don't understand how to set up the path through the MATLAB command.
"CALLING MATLAB FUNCTION AT THE MATLAB PROMPT
Use MATLAB function to a define model property with the set method:
something.set(property, myfun(<arg>));
where myfun() is a M-function defined in MATLAB.
The function is called only when the command is executed at the MATLAB prompt.
The argument of the function <arg> call be MATLAB variables. To include an
expression value from the model object, you first need to extract it at the MATLAB
prompt, as it is described in Extracting Results.
The function myfun()accepts the model object model as input argument as any
MATLAB variables."
Any help would be appreciated!
Thanks!
Sarah
I am trying to model a smart material called Magnetorheological Elastomers. It can change it's stiffness when a magnetic field is present. To do this, I would like to use a MATLAB function that can calculate the shear modulus based on the field present.
However, I keep running to the issue that the MATLAB directory is not setup correctly... I have gone into MATLAB and set the path directly to where all of the files are located and it still cannot run.
I am using MATLAB 2013a and COMSOL 4.4. I have the read the User Guide for MATLAB LiveLink and I don't understand how to set up the path through the MATLAB command.
"CALLING MATLAB FUNCTION AT THE MATLAB PROMPT
Use MATLAB function to a define model property with the set method:
something.set(property, myfun(<arg>));
where myfun() is a M-function defined in MATLAB.
The function is called only when the command is executed at the MATLAB prompt.
The argument of the function <arg> call be MATLAB variables. To include an
expression value from the model object, you first need to extract it at the MATLAB
prompt, as it is described in Extracting Results.
The function myfun()accepts the model object model as input argument as any
MATLAB variables."
Any help would be appreciated!
Thanks!
Sarah
Attachments:
3 Replies Last Post 30 giu 2014, 15:36 GMT-4