Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: Max and min & parabola

Subject: Max and min & parabola

From: Ali Hussain

Date: 26 Jun, 2008 11:39:02

Message: 1 of 6

Hello

I have 2 matrices which are below. I would like to fit a
parabola through the mins of both ends and the max point in
the middle.

I can find the point for the min but not min on both sides.
Or is there a better way of fitting a parabola?

 x=[14.8240
   15.3632
   15.9172
   16.4563
   16.9926
   17.0103
   17.5495
   18.0858
   20.9280
   22.3190
   22.8581
   23.4121
   23.9513
   24.4876
   24.5053
   25.0445
   25.5808
   26.4354
   26.7936
   27.3299
   28.1845
   28.7208
   28.4230
   29.2777
   29.8140
   30.3531
   30.3708
   30.9071
   31.4463]
y=[ 0.1275
    0.0475
    0.1725
    0.2625
   -0.0525
    0.2425
    0.3825
    0.3975
    0.3175
    1.3325
    0.4475
    1.1075
    0.9675
    0.4875
    0.4975
    0.9075
    0.8825
    0.2675
    0.1175
    0.5025
    0.7825
    0.4675
   -0.0725
    0.5975
    0.7475
    0.3025
   -0.0925
    0.3475
    0.3875]

Thanks

Subject: Max and min & parabola

From: John D'Errico

Date: 26 Jun, 2008 11:59:02

Message: 2 of 6

"Ali Hussain" <hussaizj@aston.ac.uk> wrote in message
<g3vv4l$nm2$1@fred.mathworks.com>...
> Hello
>
> I have 2 matrices which are below. I would like to fit a
> parabola through the mins of both ends and the max point in
> the middle.
>
> I can find the point for the min but not min on both sides.
> Or is there a better way of fitting a parabola?
>
> x=[14.8240

(snip)

> 0.3875]
>
> Thanks

Define "better". What are your goals here?
For example, why is not the simple polyfit
adequate for what you wish to do?

Define what you mean by "min on both sides".
If you can explain what you mean, this is the
best first step to writing code for what you
want.

John

Subject: Max and min & parabola

From: Ali Hussain

Date: 26 Jun, 2008 12:34:02

Message: 3 of 6

My aim is to fit a curve (parabola) through the min, max
and other min. Then to calculate the area underneath it.
Thats why i want to disregard the rest of the numbers..

Thanks


"John D'Errico" <woodchips@rochester.rr.com> wrote in
message <g400a6$klv$1@fred.mathworks.com>...
> "Ali Hussain" <hussaizj@aston.ac.uk> wrote in message
> <g3vv4l$nm2$1@fred.mathworks.com>...
> > Hello
> >
> > I have 2 matrices which are below. I would like to fit
a
> > parabola through the mins of both ends and the max
point in
> > the middle.
> >
> > I can find the point for the min but not min on both
sides.
> > Or is there a better way of fitting a parabola?
> >
> > x=[14.8240
>
> (snip)
>
> > 0.3875]
> >
> > Thanks
>
> Define "better". What are your goals here?
> For example, why is not the simple polyfit
> adequate for what you wish to do?
>
> Define what you mean by "min on both sides".
> If you can explain what you mean, this is the
> best first step to writing code for what you
> want.
>
> John

Subject: Max and min & parabola

From: Ali Hussain

Date: 26 Jun, 2008 14:41:02

Message: 4 of 6

"Ali Hussain" <hussaizj@aston.ac.uk> wrote in message
<g402bq$j7s$1@fred.mathworks.com>...
> My aim is to fit a curve (parabola) through the min, max
> and other min. Then to calculate the area underneath
it.
> Thats why i want to disregard the rest of the numbers..
>
> Thanks
>
>
> "John D'Errico" <woodchips@rochester.rr.com> wrote in
> message <g400a6$klv$1@fred.mathworks.com>...
> > "Ali Hussain" <hussaizj@aston.ac.uk> wrote in message
> > <g3vv4l$nm2$1@fred.mathworks.com>...
> > > Hello
> > >
> > > I have 2 matrices which are below. I would like to
fit
> a
> > > parabola through the mins of both ends and the max
> point in
> > > the middle.
> > >
> > > I can find the point for the min but not min on both
> sides.
> > > Or is there a better way of fitting a parabola?
> > >
> > > x=[14.8240
> >
> > (snip)
> >
> > > 0.3875]
> > >
> > > Thanks
> >
> > Define "better". What are your goals here?
> > For example, why is not the simple polyfit
> > adequate for what you wish to do?
> >
> > Define what you mean by "min on both sides".
> > If you can explain what you mean, this is the
> > best first step to writing code for what you
> > want.
> >
> > John
>


Does anyone know how to tackle this?

Subject: Max and min & parabola

From: David

Date: 26 Jun, 2008 16:17:02

Message: 5 of 6

"Ali Hussain" <hussaizj@aston.ac.uk> wrote in message
<g409pu$hot$1@fred.mathworks.com>...
> "Ali Hussain" <hussaizj@aston.ac.uk> wrote in message
> <g402bq$j7s$1@fred.mathworks.com>...
> > My aim is to fit a curve (parabola) through the min,
max
> > and other min. Then to calculate the area underneath
> it.
> > Thats why i want to disregard the rest of the
numbers..
> >


take the graph and draw your parabola by hand?

Graphing that data just to see what it looks like makes
your request even more confusing. obviously the end
values are not the min values since they are higher than
some of the values in between. and the highest value is
not in the middle where a simple parabola would be. so if
you don't want to use all the points for a normal curve
fit then you have to determine some method of picking the
points you 'like'. no one can help you there, we can only
give you the standard methods that are well documented.
in your case you need something unique to your data, and
since you seem to know that it should fit a parabola you
are going to have to figure out how you want to best fit a
parabola to that rather noisy data. you say 3 points, but
i don't see an easy way to pick 3 points... reduce your
data to 3 points and then we can probably help you derive
the equation of the parabola.

Subject: Max and min & parabola

From: John D'Errico

Date: 27 Jun, 2008 04:18:01

Message: 6 of 6

"Ali Hussain" <hussaizj@aston.ac.uk> wrote in message
<g409pu$hot$1@fred.mathworks.com>...
> "Ali Hussain" <hussaizj@aston.ac.uk> wrote in message
> <g402bq$j7s$1@fred.mathworks.com>...
> > My aim is to fit a curve (parabola) through the min, max
> > and other min. Then to calculate the area underneath
> it.
> > Thats why i want to disregard the rest of the numbers..
> >
> > Thanks
> >
> >
> > "John D'Errico" <woodchips@rochester.rr.com> wrote in
> > message <g400a6$klv$1@fred.mathworks.com>...
> > > "Ali Hussain" <hussaizj@aston.ac.uk> wrote in message
> > > <g3vv4l$nm2$1@fred.mathworks.com>...
> > > > Hello
> > > >
> > > > I have 2 matrices which are below. I would like to
> fit
> > a
> > > > parabola through the mins of both ends and the max
> > point in
> > > > the middle.
> > > >
> > > > I can find the point for the min but not min on both
> > sides.
> > > > Or is there a better way of fitting a parabola?
> > > >
> > > > x=[14.8240
> > >
> > > (snip)
> > >
> > > > 0.3875]
> > > >
> > > > Thanks
> > >
> > > Define "better". What are your goals here?
> > > For example, why is not the simple polyfit
> > > adequate for what you wish to do?
> > >
> > > Define what you mean by "min on both sides".
> > > If you can explain what you mean, this is the
> > > best first step to writing code for what you
> > > want.
> > >
> > > John
> >
>
>
> Does anyone know how to tackle this?

Sorry, it is simple to do, but FIRST, you need to
clearly define what you want to do. Until you
do that, you cannot write code for it.

Think about the algorithm for picking the three
points. WRITE IT DOWN. Use a flow chart if
necessary. When you are done, then it is just a
call to polyfit. But you need to learn to think
out your programming problems.

John

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics