• Notice regarding image hosts and attachments. See here.

programme to...

Associate
Joined
28 Jul 2003
Posts
1,987
Location
The Moon
I need to write a programme in MATLAB to convert my daily rainfall data into average rainfal per month. I have thousands of entries so doing this manually in Excel is a no go. Does anybody know how I can go about this? I am stumped!
 
Can't help you to do it in MATLAB, but it would be easy to acheive using MS Access and the original data (I'm assuming it's in excel) as the source.

If that's any use, let me know and I'll post some examples of how to do it.
ok great I could use access. :)
 
Ok, assuming the data is in a format something like.

Location - Date - Rainfall

First thing is to link the data as a table. Go to tables, right click, link table and select the data source.

Then go into query builder and create a new query with the following fields.

Location - =month(date) - rainfall

This will give you the location, the month and the rainfall for each day.

Then create a second query (you can use the query wizard for the one) and create a summary query based on the query you have just made. Choose average for rainfall in summary options, and then group by location and month.

Run that query, and you'll produce a list of average monthly data for each location.

If that's ok, let me know, if you don't understand, let me know and I'll try and break it down simpler, or let me know the data structure and I'll see what I can put together for you.

Thanks a lot. My data is in this format: date (in column 1) and rainfall (in column 2). Would this alter it much?
 
OK it doesn't seem to be working for me, I've probably done something wrong. It jus gives me the the wrong average for the first 4 months and then nothing else.
 
hmmm, odd. I have no idea why it's doing that.

Do you just need the output? if so I'll export it to excel and send it to you, if not, I'll copy the SQL and send that to you to recreate the query yourself.

If you could send me the SQL that would be great.
 
Back
Top Bottom