How to calculate occurrence in percentage?
Ältere Kommentare anzeigen
Hi Everybody,
I want to calculate variation of s4>=0.2 occurrence in percentage. To know how many events observed during 0-24 hr then have a comparison in different times and then plot it vs time. Could you please guide me? Here is the code;
clear;clc;close all;
data=xlsread('filename.xls');
data_nozero=find(data(:,3)>30);
newdata=data(data_nozero,:);
data_filterr=find(newdata(:,25)>60);
data_filtered=newdata(data_filterr,:);
elev_cutof20=find(data_filtered(:,6)>=15);
data_cutoff15=data_filtered(elev_cutof20,:);
r=data_cutoff15(:,2);
time=(r./3600)-24*1;
s4r=data_cutoff15(:,8);
s4cor=data_cutoff15(:,9);
s4=sqrt(s4r.^2-s4cor.^2);
12 Kommentare
Jing
am 7 Mär. 2013
I'm not quite understand your question. What you asked is the percentage of s4>=0.2 ?
Ara
am 7 Mär. 2013
Jing
am 7 Mär. 2013
So the problem is plotting or calculating?
Ara
am 7 Mär. 2013
Walter Roberson
am 7 Mär. 2013
What is expected in your "r" variable? What are you expecting in your "time" variable?
Ara
am 7 Mär. 2013
Walter Roberson
am 7 Mär. 2013
What would be the calculation to allow you to calculate the time of day ?
Walter Roberson
am 7 Mär. 2013
Bearbeitet: Walter Roberson
am 7 Mär. 2013
Could you confirm that the second column is (seconds since the beginning of the "GPS week", plus 24 hours worth of seconds), and thus the first entry in the file is 1 minute into the "GPS week" ?
If so then why is the maximum value equivalent to 24 hours rather than equivalent to 7 days of 24 hours ?
Should the counts for 24:00 be included in hour 0, or in hour 23, or a count of its own?
Walter Roberson
am 7 Mär. 2013
The data file you linked to starts column 2 at 86460, which is 24*60*60 + 60; it ends column 2 at 172800 which is 24*60*60 + 24*60*60. Which disagrees with what you said in it not being a constant value.
Okay, so time=(r./3600)-24*day of week; now, should the minute in which the day rolls over be counted with the previous day or the new day? The data file does not start with time 0 minutes into day 1 (it starts 1 minute in) and the data file ends with 24 hours 0 minutes into day 1. So should the day be considered to run from 00:01 to 24:00, or was there possibly a splitting error and it should have been from 00:00 to 23:59 ?
More generally, should the count for any hour itself be included in the previous hour or in the new one? For example, there is 04:59, 05:00, 05:01, so should the bins be 04:01 - 05:00, 05:01 - 06:00, or should they be 04:00 - 04:59, 05:00 - 05:59 ?
Ara
am 7 Mär. 2013
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Data Distribution Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!