"Nasser M. Abbasi" <nma@12000.org> wrote in message
news:ju2rjl$kno$1@speranza.aioe.org...
> On 7/16/2012 11:37 PM, Animesh Pandey wrote:
>> TideMan <mulgor@gmail.com> wrote in message
>> <0eb0ae527cb64fcba673b0963ad971fd@googlegroups.com>...
>>> On Tuesday, July 17, 2012 8:25:05 AM UTC+12, Animesh Pandey wrote:
>>>> How do I plot a graph like ...
>>>>
>>>> 1 <= x^2 + y^2 + 10*x +25 <= 121 .... ?
>>>>
>>>> Please help!
>>>> Thanks!
>>>
>>> What sort of graph?
>>> contour? help contour
>>> surface? help surf
>>
>
>> In english it is ...
>> plot those values of x, y where the value of the expression,
>>x^2 + y^2 + 10*x +25, is between and 1 and 121 ....
>>
>
> THis will get you started.
>
> In[12]:= expr=x^2+y^2+10*x+25;
> Reduce[1<expr<121,{x,y}]
Nasser,
Not a big deal, but I think you forgot to which newsgroup you were currently
posting, as that looks like Mathematica code not MATLAB code.
Animesh,
A quick and dirty way to do this:
[x, y] = meshgrid(20:0.1:7, 15:0.1:15);
z = x.^2 + y.^2 + 10*x + 25;
% Z's outside the limits you specified are replaced by NaN
z(z < 1) = NaN;
z(z > 121) = NaN;
% NaN values don't show up in a surface plot
surf(x, y, z)
shading interp % to avoid the grid lines concealing all the colored faces
I chose the limits via trial and error to include the region of interest for
your function.

Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com
