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.

simple question regarding Matlab script

Please login with a confirmed email address before reporting spam

Hi all?

In my parametric analysis of the insertion of a probe into the brain, I have the parameter "time", which dictates the displacement of the probe by diplacement = time*0.2

In Matlab, I want to have the probe displace when the time is less than 20e-3(s) and stop after this threshold.

The original Matlab script for the displacement boundary condition is written as :

bnd.Rz = {0,0,'-time'};

I want to change it to the following:

if ('time' < 20e-3)
bnd.Rz = {0,0,'-time'};
else
bnd.Rz = {0,0,0};
end

The problem is I don't think I am expressing the value of the parameter 'time' correctly... Can someone teach me how to write it correctly? I don't know the syntax well. Basically I want to say, when the value of the the parameter "time" is greater than 20e-3(s), then stop the displacement.

Thank you!

Joe

0 Replies Last Post 16 août 2010, 20:50 UTC−4
COMSOL Moderator

Hello Joe Xiao

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.

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.