Thread Subject: Difference

Subject: Difference

From: Simon Buckley

Date: 23 Nov, 2009 14:15:08

Message: 1 of 3

Hey guys,

I am using outlier analysis and have a cell array of 15x405 each with 1 x 150. I have set a threshold and every number over a certain number is considered an outlier,thuis becomes 1. Everyone below becomes 0. I want to count the 1s backwards e.g say 150-130 are.........1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 I would want to write a program to say the the novelty score would be 19,. I know I should use the diff function but how would i set up the counter for the novelty score?

Hope this makes sense

Simon

Subject: Difference

From: ImageAnalyst

Date: 23 Nov, 2009 14:32:56

Message: 2 of 3

On Nov 23, 9:15 am, "Simon Buckley" <Simonthomasbuck...@gmail.com>
wrote:
> Hey guys,
>
> I am using outlier analysis and have a cell array of 15x405 each with 1 x 150. I have set a threshold and every number over a certain number is considered an outlier,thuis becomes 1. Everyone below becomes 0.  I want to count the 1s backwards e.g say  150-130 are.........1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 I would want to write a program to say the the novelty score would be 19,. I know I should use the diff function but how would i set up the counter for the novelty score?
>
> Hope this makes sense
>
> Simon

----------------------------------------------------------------
Simon:
I'm not exactly sure what novelty score is, but would this do the job:

clc;
close all;
clear all;
a = 1:150 % Make up some arbitrary sample data values.
tresholdedA = a >= 145
lastZero = find(tresholdedA == 0, 1, 'last')
noveltyScore = length(a) - lastZero

Subject: Difference

From: Simon Buckley

Date: 23 Nov, 2009 14:39:04

Message: 3 of 3

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <cceac0dd-662b-42a3-88f9-9f6caf6e18f0@k9g2000vbl.googlegroups.com>...
> On Nov 23, 9:15?am, "Simon Buckley" <Simonthomasbuck...@gmail.com>
> wrote:
> > Hey guys,
> >
> > I am using outlier analysis and have a cell array of 15x405 each with 1 x 150. I have set a threshold and every number over a certain number is considered an outlier,thuis becomes 1. Everyone below becomes 0. ?I want to count the 1s backwards e.g say ?150-130 are.........1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 I would want to write a program to say the the novelty score would be 19,. I know I should use the diff function but how would i set up the counter for the novelty score?
> >
> > Hope this makes sense
> >
> > Simon
>
> ----------------------------------------------------------------
> Simon:
> I'm not exactly sure what novelty score is, but would this do the job:
>
> clc;
> close all;
> clear all;
> a = 1:150 % Make up some arbitrary sample data values.
> tresholdedA = a >= 145
> lastZero = find(tresholdedA == 0, 1, 'last')
> noveltyScore = length(a) - lastZero

Sorry Novelty_score was just a name. Thanks for the tips

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

Contact us at files@mathworks.com