How can I define a symbolic function over a specific region?

8 views (last 30 days)
I need to define a two dimensional, let's say exponential, function over a certain ring, say from R=2 to R=3.
I tried to define assumptions on the variables X and Y such that 2<= X^2+Y^2 <= 3 , and then define the function
F=exp(-0.5*(X^2+Y^2));
when I ezplot, I find the function F defined over the whole domain not over the ring I defined. How can I insert such bounds for both 'the variables' and 'the function' ? In other words, How can I limit the output of the function to a certain slice of the domain?
Thanks,
Waleed

Answers (1)

Wayne King
Wayne King on 15 Jan 2013
F=exp(-0.5*(X^2+Y^2));
ezsurf(F,[-2,2,-2,2])
In the above -2 <= X <= 2 and -2 <= Y <= 2
  1 Comment
Waleed Khedr
Waleed Khedr on 15 Jan 2013
Thank you Wayne for the contribution .. but may be I wasn't clear about my problem....your code provide a square domain that takes all the values from X:[-2:2] and Y:[-2:2], while my requirement is to have a ring 'the region between two circles with radius R=2 and R=3' which means ONLY the values that satisfy 2<= X^2+Y^2 <= 3. In addition, this is a way to overcome the problem of plotting not the analysis, in case I tried to apply any operator on the function F in that form it will not be applied on my desired region, it will be applied on the whole region, which is not what I need. Thanks again,

Sign in to comment.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!