|
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
|