Code covered by the BSD License  

Highlights from
HOWCOMMON

Be the first to rate this file! 2 Downloads (last 30 days) File Size: 1.92 KB File ID: #12633

HOWCOMMON

by Jeff Dunne

 

13 Oct 2006 (Updated 16 Oct 2006)

Supports data filtering for potentially redundant data streams

| Watch this File

File Information
Description

HOWCOMMON takes a pair of vectors and returns uniquely sampled domains with corresponding values for the range. Unlike functions such as INTERP, however, duplicate domain input values are accepted, and the appropriate type of output can be user specified.

For example, suppose one had:

x = [1 2 3 3 4 5 5 5 ];
y = [10 20 30 31 40 51 52 53];

[domain,num,range] = HOWCOMMON(x,y,'min')

returns:

domain = [1 2 3 4 5 ];
num = [1 1 2 1 3 ];
range = [10 20 30 40 50];

Instead of 'min', one could use:

'max' (range = [10 20 31 40 52])
'mean' (range = [10 20 30.5 40 51])
'sum' (range = [10 20 61 40 153])

MATLAB release MATLAB 7 (R14)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
matrices Jeff Dunne 22 Oct 2008 08:43:48
matrix statistics mean sum max min Jeff Dunne 22 Oct 2008 08:43:48
probability Cristina McIntire 07 Nov 2008 12:09:47

Contact us at files@mathworks.com