COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### problem in plotting !!

• Email
• Follow

How do I plot a graph like ...

1 <=  x^2 + y^2 + 10*x +25 <= 121 .... ?

Thanks!

 0
Reply apanimesh061 (35) 7/16/2012 8:25:05 PM

See related articles to this posting

On Monday, July 16, 2012 3:25:05 PM UTC-5, Animesh Pandey wrote:
> How do I plot a graph like ...
>
> 1 &lt;=  x^2 + y^2 + 10*x +25 &lt;= 121 .... ?
>
> Thanks!

explain in englisho what it mean? what like function do that

 0
Reply steve.nospamm (54) 7/16/2012 8:32:52 PM

On Tuesday, July 17, 2012 8:25:05 AM UTC+12, Animesh Pandey wrote:
> How do I plot a graph like ...
>
> 1 &lt;=  x^2 + y^2 + 10*x +25 &lt;= 121 .... ?
>
> Thanks!

What sort of graph?
contour?   help contour
surface?   help surf

 0
Reply mulgor (3011) 7/16/2012 10:01:32 PM

TideMan <mulgor@gmail.com> wrote in message <0eb0ae52-7cb6-4fcb-a673-b0963ad971fd@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 .... ?
> >
> > 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 ....

A normal planar graph or a contour graph is required!

Thanks!

 0
Reply apanimesh061 (35) 7/17/2012 4:37:48 AM

On 7/16/2012 11:37 PM, Animesh Pandey wrote:
>> 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 .... ?
>>>
>>> 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}]

(-16<x<-6&&-Sqrt[96-10 x-x^2]<y<Sqrt[96-10 x-x^2])||

(-6<=x<=-4&&(-Sqrt[96-10 x-x^2]<y<-Sqrt[-24-10 x-x^2]||Sqrt[-24-10 x-x^2]<y<Sqrt[96-10 x-x^2]))||

(-4<x<6&&-Sqrt[96-10 x-x^2]<y<Sqrt[96-10 x-x^2])

So, you have 3 cases to select.  the || means OR in case you did not know.

Now you have the relations, you can generate the points that satisfy this
and make the plot.

hth,

--Nasser

 0


"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
>>> 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 .... ?
>>>>
>>>> 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

--
Steve Lord
slord@mathworks.com
http://www.mathworks.com


 0
Reply slord (13686) 7/17/2012 4:44:56 PM

5 Replies
48 Views

Similar Articles

12/13/2013 10:13:19 PM
[PageSpeed]

Similar Artilces:

Problem with plotting a exponential in a 2D line plot.
Hello, this is my code: f=exp(-0.5*x.^2); t=0.5; h_xt=exp(-(x-3*t).^2); figure(2) plot(f,'-r') hold on plot(h_xt,'-k') Does anyone know why this doesn't show on the plot? "Per Christian " <pc.ekre@gmail.com> wrote in message news:j89i56$mha$1@newscl01ah.mathworks.com... > Hello, > > this is my code: > > f=exp(-0.5*x.^2); > t=0.5; > h_xt=exp(-(x-3*t).^2); > figure(2) > plot(f,'-r') > hold on > plot(h_xt,'-k') > > Does anyone know why this doesn't show on the plot? Not without seeing x. Keep in...

problem maximizing plots & interfacing plots with saveppt
Hi, I am using a version of saveppt.m that I modified for my specific needs. This version takes a specific template (I can post the code for that if there are those who are interested). Anyway, what I am having difficulties with is that the plot windows come up not maximized, and then saveppt saves the plots as they appear on screen (the tick labels are all scrunched together, etc). What I would like to do is to be able to maximize the plot window, such that it is analogous to clicking on the "maximze" button in the upper right corner of the plot window - this is different than ju...

Problem with plot
Hello, my Name is Jorge Gracia and I'm a newbie here in this forum and also using matlab. I have a problem creating a plot. I have this in Matlab in a m-file: l_min = 0; l_max = 30; anzahl = 5; geschw=(-40000:(80000/(20/0.1)):40000)'; for i=0:anzahl-1 L = l_min + ((l_max-l_min)/(anzahl-1))*i; load_system('Reibkraft.mdl'); sim('Reibkraft'); Reibkraft = F_r; subplot(1,1,1,'Parent', Hauptfenster); plot(geschw,Reibkraft); title('Reibungskennlinien'); xlabel('Geschwindigkeit [mm/min]'); ...

plotting problem
SW 2005 SP 0.1 WIN2K plotting to HP Designjet 500 HP-GL. I wanted a 1=1 C size plot, loaded the sheet in the plotter in "profile" and selected landscape in SW page setup. Margins were off and only plotted 90% of the drawig. I fixed the problem by loading the sheet in the plotter in "lanscape" and plotting in "landscape". That means I cannot plot to D-size on this plotter using SW. Has anyone tried and had success with loading the sheet in profile and plotting in landscape? Thanks in advance. Arif Oguz ...

Plot problem
Hi everyone! I want to solve these equations and plot. Please tell me how. There are two equations; Lamda = Sqrt[R A x/B], R = C x (D + E/Lamda) (A,B,C,D,E : constants, x : another variable) I need to plot R versus x. Please help me. Thank you in advance. If you use capital letters for your variables they will get confused with Mathematica definitions, e.g., E has a definition N[E] 2.71828 Clear[r]; r[a_,b_,c_,d_,e_,x_]:=Evaluate[r/.Solve[ {lamda==Sqrt[r*a*x/b],r==c *x *(d+e/lamda)}, r,lamda][[1]]//Simplify]; r[a,b,c,d,e,x] ...

plot problem #9
im facing a strange problem with plot command, here is the code ///////////////////////////////// frate=linspace(1,10,10); % 10 points for Depti = 1:length(Dept) % THE PROBLEM when Dept =10 for fratei = 1:size(frate,2) [Values] = getvalue(); AccumValues(fratei)=Values; plot(frate,[Accum ; AccumValues]); end drawnow; end Accum = [Accum; AccumValues]; end ///////// the problem is, when Dept = frate, the figure shows totally wrong data, and even currput the previous data, to be noted: im drawing the data inside the loop ...

problem with plotting an equation
hi everyone, i am recently started working with MATLAB.I am facing a problen in plotting equation mentioned below..can anyone help me!? x=1:5:1000; e=('enter a value'); % HERE IS THE PROBLEM .HOW CAN GIVE THIS VALUE TO NEXT LINE?% z=(1-x^.2)+(2*e*x).^2; y=1\sqrt(z); plot(x,y) You were close: x=1:5:1000; e = input('Enter a value: '); z =(1-x.^2)+(2*e*x).^2; y=1\sqrt(z); plot(x,y) "Matt Fig" <spamanon@yahoo.com> wrote in message <gtd7e7$egd$1@fred.mathworks.com>... > You were close: > > > > > x=1:5:1000; > e = i...

Problem with plotting line ....?
Hi to all ... Here is my very simple code ... its take 1 byte from serial and draw on graph by using plot command and doing this very perfectly but the problem is that it is only plotting marker but not line , I cant figure out the problem because in code there is nothing so different i used simple plot example from matlab help... (my input to ADC is From Variable POt)..., Any Help Plz ...? Thank You... s=serial('com1') set(s,'InputbufferSize',1); set(s,'Timeout',5); q=0; get(s); x=1; y=0; fopen(s); while (q~=5) q=q+1; out=fread(s)*0.01953 x=[x+1] y= ...

problem in plotting data
Hi, All, suppose data (it can be any data): x = -pi:0.01:pi; y = sin(x); Now plot the data pare: figure semilogy(x,y) hold on I get the plot in which y-scale is log. But if I write: figure hold on semilogy(x,y) I cannot get it in semilogy, but in linear scale. Does anyone know why? Thanks. David David wrote: > > > Hi, All, > > suppose data (it can be any data): > x = -pi:0.01:pi; > y = sin(x); > > Now plot the data pare: > figure > semilogy(x,y) > hold on > > I get the plot in which y-scale is log. But if I write: > figure > hold on > ...

problem with plot #3
Hi, I'm writing to you because I have a problem with that code, it gives me the good values but the plot does'nt work (it plots nothing). Can somebody help me please? Thanks a lot. c=3*10^8; f=2*10^6; R=20000; Imax=10; theta=90*(pi/180); lambda=c/f; beta=2*pi/lambda; %H=lambda*length; for length=0:0.1:1 H=lambda*length; E=abs((60*Imax/R)*((cos(beta*H*cos(theta))-cos(beta*H))/sin(theta))) %plot(length,E); end plot(length,E); On 11 Mar, 19:53, Hussard11 <t...@club-internet.fr> wrote: > Hi, I'm writing to you because I have a problem with that code, it > gi...

A problem in plotting a figure !!!!
t = -4 : 0.01 : 4; r = @(t) t.*(t>=0).*(t>=0 & t<=1); h = @(t) (t>=0).*(t>=0 & t<=1); i = @(t) (t==0); x = @(t) r(t+2) + 2*h(t+1) + h(t) + -r(t-1); plot(t, x(t), 'r'), grid on In this question I am getting two impulses at t = -1 and t = 0 above the edge at x = 2 , but I don't need those pulses. Can you suggest a better way to plot the figure or may be a way to remove the impulses ??? Please help !!!! On Feb 21, 6:01=A0am, "Animesh Pandey" <apanimesh...@gmail.com> wrote: > t =3D -4 : 0.01 : 4; > r =3D @(t) t.*(t>=3...

Problems with plotting errorbar
Hi. I'm using the following code: x = [ 0.4392 0.4392 0.4392 ; 0.4458 2.0410 0.5147 ; ... 1.2783 1.2783 1.2783 ; 0.8419 0.9173 0.9127 ; ... 1.1915 1.1915 1.1915 ; 0.3878 1.1379 1.0704 ]; z = [ 0.0382 0.0382 0.0382 ; 0.1097 0.0758 0.0511 ; ... 0.0879 0.0879 0.0879 ; 0.1548 0.0663 0.0773 ; ... 0.1100 0.1100 0.1100 ; 0.1284 0.0866 0.1206 ]; clf bar(x) hold on errorbar(x,z,'.') The bar plot is ok, as I expected it would be, but the errorbars appear all stacked one over an...

plot problem #7
Hi all!! x = [5]; y = [5]; c=imread('FRONT.jpg'); image(c); hold on plot (x,y,'g.','MarkerSize',1); when I want to plot, no point is apparent on screen. when I choose (x,y) = (6,6) a point is apparent on screen. shouldn't a graph start from (0,0) or (1,1) instead?? Thanks in advance!! (image FRONT.jpg is a 770x770 picture) "recep mansiz" <aalmoraa@hotmail.com> wrote in message <h8vjnc$7cm$1@fred.mathworks.com>... > Hi all!! > > x = [5]; > y = [5]; > > c=imread('FRONT.jpg'); > image(c); > hold on > pl...

problem with contourf plot
i am trying to plot a contourf plot using this data contourf(A,B,C) A = [-65,-58,5,-52,-45,5,-39;-65,-58,5,-52,-45,5,-39;-65,-58,5,-52,-45,5,- 39;-65,-58,5,-52,-45,5,-39;-65,-58,5,-52,-45,5,-39] B = [-16,-16,-16,-16,-16;-8,-8,-8,-8,-8;0,0,0,0,0;8,8,8,8,8;16,16,16,16,16 ] C = [-26.1036,-26.1036,-35.8421,-35.8421,-34.9322;-35.0509,-35.0509,-25.78 94,-25.7894,-23.4795;-35.0509,-35.0509,-25.7894,-25.7894,-23.4795;-36. 2414,-36.2414,-50.0799,-50.0799,-36.1699;-36.2414,-36.2414,-50.0799,-5 0.0799,-36.1699] but this is giving an error like ??? Index exceeds matrix dimensions. Error in ==> spec...

excel plot problem
Hi guys, well I've manage to plot a set a a graphs in excel using matlab via the actxserver of course.......and I almost succeeded except There is a little bump in the road that I encountered. 2....I'm trying to change the gap width of data to 50 1....the alignment of the data on the x-axis has to be pointing upwards 3.....make the graph display the values and set them to 1 d.p. Here is what I've comeup with (of course matlab keep returning errors): exl= actxserver('excel.application'); dr='C:\Users\Me\Desktop\'; file='Templatexls.xls'; % Lo...

Problem with legend in plot
Hi I am using r07a matlab and am facing problem with legend the error says: ??? Error using ==> hgconvertunits Invalid object handle. Error in ==> legend>make_legend at 386 lh=scribe.legend (ha,orient,location,position,children,listen,strings,proparg s{:}); Error in ==> legend at 285 [h,msg] = make_legend(ha,varargin(arg:end)); Error in ==> Untitled at 2 plot(rand(10,1),'-o');legend('x'); -- i am using a simple plot: figure; plot(rand(10,1),'-o');legend('x'); Please suggest wht is the problem ...

problem with 4d plot
Hello every body i have a problem in plotting a 4 d plot. i have data set for all 4 variable [X, Y, Z, I] x=25762 x 1 y=25762 x 1 z=25762 x 1 I = 25762 x 1 can any one help in this regard, "aftab Ahmad" <aftaba@kth.se> wrote in message news:i5llvr$c0c$1@fred.mathworks.com... > Hello every body i have a problem in plotting a 4 d plot. i have data set > for all 4 variable [X, Y, Z, I] > > x=25762 x 1 y=25762 x 1 z=25762 x 1 I = > 25762 x 1 > can any one help in this ...

Plotting problem 110434
Hi, I have some data I would like to plot. It is shear stresses as the function of flow rate. The scale of the data is quite large, x varies from 0.01 to 100 and y varies from 3e-5 to 1.5e-1. Below I have the code that I wrote but the figure doesn't seem quite right. Could someone help me that I could fit my data properly, thanks in advance. % flow rates q = [0.01 0.05 0.1 0.5 1 5 10 50 100]; % shear stresses shear = [3e-5 1.5e-4 3e-4 1.5e-3 3e-3 1.5e-2 3e-2 1.5e-1 3e-1]; p = semilogy(q,shear) %#ok<NOPTS> set(gca,'XTickLabel',{'0.01';'0.05'...

Plotting Problem in MATLAB
Hi, I encountered a plotting problem in MATLAB. After I plotted a graph, I used the axis command to try to change the scale of the x-and y-axis. Supposedly, as I understand it, the axis scale on the plot should be changed and the lines on the graph would be updated according to the new scale. But somehow the lines and dots on the plot disappeared even though the scale did changed according to my axis command. Can anyone help me with this problem? Thanks in advance. C. Loong C. Loong wrote: > Hi, > > I encountered a plotting problem in MATLAB. After I plotted a graph, > I used ...

Basic Plotting Problem
Hi guys, I am a complete novice at using MATLAB and have a problem with comparing two graphs I have. Currently I have two graphs on the same plot but one graph is 0.05 sec out of phase. I was wondering if it was possible to move the one of the plots back 0.05 seconds, so that both plots are identical. I have tried modifying the xdata by subtracting 0.05 from each of the x-values but this is a tedious process. Any help would be appreciated. In article <15563393.1218257888372.JavaMail.jakarta@nitrogen.mathforum.org>, PeNciLuZeR <random12341@yahoo.com.au> wrote: >I am a compl...