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.

Expression

Juan Felipe Monsalvo Salazar

Please login with a confirmed email address before reporting spam

Hi,
I’m modeling a component from the importation of an image. As you know when you import an image, you obtained a function im1(x,y)=(R+G+B)/3 , so is easy to separate only two material. Using the following expression:
Material1*(im1(x,y)<=0.5)+Material2*( im1(x,y)>0.5)

But when i try to do an analytic function in order to distinguish 4 different materials in the image I’m not able to realize a good expression, because there are element that are between at range, but when I applied the following expression:
Material1*(im1(x,y)>=0.9)+Material2*( 0.7<=im1(x,y)<0.9)+Material3*(0.5<=im1(x,y)<0.7)+Material4(im1<0.5)

That doesn’t work and I can only supposed that the expression (0.5<=im1(x,y)<0.7) is incorrect or not supported by Comsol…So if somebody can help me or teach me at little more about the expression that you can input in Comsol I would be very grateful

2 Replies Last Post 7 juil. 2012, 15:46 UTC−4

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 6 juil. 2012, 18:20 UTC−4
Either (0.5<=im1(x,y)&im1(x,y)<0.7) or (0.5<=im1(x,y)&&im1(x,y)<0.7) should work
Either (0.5

Juan Felipe Monsalvo Salazar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 7 juil. 2012, 15:46 UTC−4
Thank a lot
Thank a lot

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.