Thread Subject: mean between two curves

Subject: mean between two curves

From: rubionelove

Date: 5 Oct, 2009 12:34:04

Message: 1 of 4

Hi all,
I've two set of data, I'd like to plot the number of features detected in function of the area in pixels.
I'd like to combine the two set of data, to have the mean of the two curves.
The problem is that now they have not the same values on the "area in pixels column".
How can I do that ?



area in pixels n features
15728 70
11561 59
7856 46
5185 35
3053 24
1294 14
315 5

area in pixels n features
16097 47
11858 37
8220 31
5182 31
3053 24
1294 12
315 7

Subject: mean between two curves

From: ImageAnalyst

Date: 5 Oct, 2009 22:30:06

Message: 2 of 4

On Oct 5, 8:34 am, "rubionelove " <rubionel...@gmail.com> wrote:
> Hi all,
> I've two set of data, I'd like to plot  the number of features detected in function of the area in pixels.
> I'd like to combine the two set of data, to have the mean of the two curves.
> The problem is that now they have not the same values on the "area in pixels column".  
> How can I do that ?
>
> area in pixels   n features
> 15728         70
> 11561         59
> 7856                  46
> 5185                35
> 3053                   24
> 1294                14
> 315                     5
>
> area in pixels   n features
> 16097              47
> 11858              37
> 8220                       31
> 5182                       31
> 3053                       24
> 1294                       12
> 315                       7

------------------------------------------------------------------
Can't you just concatenate the two arrays, use sortrows() and then use
plot()?
I'm not sure what "the mean of the two curves" means. Can you define
that operation mathematically?

Subject: mean between two curves

From: Miroslav Balda

Date: 6 Oct, 2009 15:07:03

Message: 3 of 4

SNIP
Hi,
Aren't you looking for someting lig the following?

A=[15728 70
11561 59
7856 46
5185 35
3053 24
1294 14
315 5];

B=[16097 47
11858 37
8220 31
5182 31
3053 24
1294 12
315 7 ];

C=(A+B)/2;

close all
plot(A(:,1),A(:,2),'ob'); hold on
plot(B(:,1),B(:,2),'og')
plot(C(:,1),C(:,2),'or')

Mira

Subject: mean between two curves

From: Alan B

Date: 6 Oct, 2009 15:49:02

Message: 4 of 4

"rubionelove " <rubionelove@gmail.com> wrote in message <hacp3s$rbj$1@fred.mathworks.com>...
> Hi all,
> I've two set of data, I'd like to plot the number of features detected in function of the area in pixels.
> I'd like to combine the two set of data, to have the mean of the two curves.
> The problem is that now they have not the same values on the "area in pixels column".
> How can I do that ?

As ImageAnalyst said, your question isn't clearly defined, but here is the answer to the first interpretation that comes to my mind:

a=[15728 70
11561 59
7856 46
5185 35
3053 24
1294 14
315 5];
b=[16097 47
11858 37
8220 31
5182 31
3053 24
1294 12
315 7 ];

x=linspace(315,16097,7);
y1=interp1(a(:,1),a(:,2),x,'linear','extrap');
y2=interp1(b(:,1),b(:,2),x,'linear','extrap');
clf, plot(a(:,1),a(:,2),b(:,1),b(:,2),x,y1,x,y2,x,(y1+y2)/2)

Tags for this Thread

Everyone's Tags:

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.

Tag Activity for This Thread
Tag Applied By Date/Time
curves mean rubionelove 5 Oct, 2009 08:39:03
rssFeed for this Thread

Contact us at files@mathworks.com