I'm fairly new to MATLAB, and I've been trying to make an m file. What I want this to do is the following...
I have a data sheet (effectively could be infinite columns and rows long)
I need to find weighted average of my data.
So for example say I have this data sheet
A B C
2 0 43
2 0 45
3 2 56
1 3 22
1 4 20
2 5 45
2 7 46
2 8 45
2 9 42
Okay so column A is the group they're catagorized in, IE, 0-25 is 1, 25-50 is 2, etc...
column B is seconds notice readings were sometimes taken during the same second therefore it is counted as one.
So what I need to do. Is make a code where I can find weighted average of C compared with time, But i need total time and not just max time minus min time because that doesn't work. and since they have breaks I wanted to be able to do something ot the extent of, in accordance with my fake data sheet, take the first 2 values subtract their time then multiple by the average of the first 2 C's. then go down to the next set of 2's and do the same thing? does this make sense? if not I can try to explain further thanks.