#not sure where my error is

13 messages · Page 1 of 1 (latest)

silver pecan
#

hi! i have an assignment on printing out values of some temperature thing and i have a document full of data.

The data contains sensor readings from 7:00 AM to 8:59 PM at intervals of 15 mins. There are 30 days of readings per month and three months of data (i.e. April, May and June) are recorded.

basically i got everything figured out but the values calculated are wrong when i compare them to my manual calculations and i suspect that the error lies in the array storing part. oddly enough, the first few mean calculated for each month seems to be correct then goes downhill. to try calculating on your own you just take the average of the first 4 values and that is 1 hour worth of readings then the average for the next 4 values for the 2nd hour and so on.

ill attach the raw data document and my original code in a bit

misty shoalBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

silver pecan
#

this is the data

safe monolith
#

It looks like when you pass in your arrays as arguments, you grab the indices NUM_DAYS, NUM_HOURS, and then you pass a pointer to that out of bounds element

#

You already have the array declared, you don't need to repeat its type information everywhere like that

#

Also make sure you actually want population st.dev instead of sample st.dev, they have a slightly different formula

silver pecan
#

wait so what do i do

safe monolith
#

Yeah. For example, when you call hourave(readings, &april_arrays[NUM_DAYS][NUM_HOURS], 0);

#

You're indexing to NUM_DAYS, NUM_HOURS and then passing a pointer to that

#

If you still don't understand, you just want hourave(readings, april_arrays, 0);. Similarly for the rest of your function calls