Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!k36g2000pri.googlegroups.com!not-for-mail
From: Richard Brown <rgbrown@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How do I plot the second derivative of the lower half of a 
	circle?
Date: Tue, 11 Nov 2008 13:06:12 -0800 (PST)
Organization: http://groups.google.com
Lines: 54
Message-ID: <c3b1a120-c4ff-4f53-a0b1-3402e4b975b2@k36g2000pri.googlegroups.com>
References: <gfcq26$p57$1@fred.mathworks.com>
NNTP-Posting-Host: 132.181.20.101
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1226437573 8632 127.0.0.1 (11 Nov 2008 21:06:13 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 11 Nov 2008 21:06:13 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: k36g2000pri.googlegroups.com; posting-host=132.181.20.101; 
	posting-account=5DWgtQoAAADZdTVggSYh0-5t5XsYVHS8
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.3) 
	Gecko/2008101315 Ubuntu/8.10 (intrepid) Firefox/3.0.3,gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:500291


On Nov 12, 9:31=A0am, "Gerry Puckett" <egpuck...@ucdavis.edu> wrote:
> I am having difficulty understanding the syntax of defining a function th=
at - from the point of view of MATLAB - is really an array of values of tha=
t function.
>
> So for example,
>
> % c(x) is the circle that passes through (x_l, y_l) and (x_r, y_r)
> % and has center (x_c, y_c) and radius R.
>
> zmin =3D x_c;
> zmax =3D x_c + R;
>
> dz =3D 1/1000;
> z =3D zmin : dz : zmax;
>
> c =3D y_c - sqrt( R^2 - (z - x_c).^2 );
>
> plot(z, c, 'r');
>
> produces the plot of the portion of the circle that I want. =A0However, n=
ow I want to plot the second derivative of c(x) over the same interval and =
I've tried
>
> cpp =3D R*R / (sqrt( R^2 - (z - x_c).^2 )).^3;
>
> and a number of other expressions to no avail. =A0I apparently don't unde=
rstand the syntax ".^" and a number of other things about =A0MATLAB. =A0(I'=
m an old hand at FORTRAN and a variety of other computer languages and it s=
eems that I should be able to
> define a function
>
> function cpp(z) =3D R*R / (sqrt( R^2 - (z - x_c)^2 ))^3;
>
> and either implicitly or explicitly loop over the values of z and plot th=
e pair (z, cpp(z)). =A0However, I haven't found the appropriate part of MAT=
LAB help that shows me how to do this.
>
> I do have the symbolic toolbox, if that is the only way to accomplish wha=
t I want. =A0However, it seems logical that MATLAB must have a way to plot =
something as straight forward as , for example
>
> =A01/ sqrt( R^2 - (z - x_c)^2 ))^3;
>
> Thanks for your help!

Missing one more dot, should be dot-divide

cpp =3D R*R ./ (sqrt( R^2 - (z - x_c).^2 )).^3;

cheers,

Richard
          ^^^