From: Chris on
"Wayne King" <wmkingty(a)gmail.com> wrote in message <htoloe$luj$1(a)fred.mathworks.com>...
> "Chris " <chris.veinot(a)hotmail.com> wrote in message <htol1c$6ht$1(a)fred.mathworks.com>...
> > "Wayne King" <wmkingty(a)gmail.com> wrote in message <htokis$7k4$1(a)fred.mathworks.com>...
> > > "Chris " <chris.veinot(a)hotmail.com> wrote in message <htok3o$7a5$1(a)fred.mathworks.com>...
> > > > Hi,
> > > >
> > > > I have an excel sheet with sediment data ~1500 rows, each row is comprised of various data such as station id, lat, long, particle diameter etc. There are about 75 different stations and about 20 samples from each station. I am looking to calculate the average diameter in matlab of each station based on it's station id #. Thanks for the help.
> > >
> > > Hi Chris, have you read the data into Matlab using xlsread? It should be a simple matter of calculating the mean at that point.
> > >
> >
> > I'm fairly new to Matlab, but yes I can read the spreadsheet, I'm just not sure how to read specific colums and rows.
> > > Wayne
>
> I'm not sure I understand your data structure. When you say:
> "> I have an excel sheet with sediment data ~1500 rows, each row is comprised of various data such as station id, lat, long, particle diameter etc."
> Are you saying that each row is one kind of data, e.g. station id, or in each row do you have multiple measurements of different data, e.g. station id, lat, long, etc.
>
> You can also do File -> Import Data and Matlab will basically walk you through importing the data, including creating a variable based on a row or column header.
>
> Wayne

Each row is comprised of colums that have the headers station id lat long etc... so i have multiple measurements of data in each row
From: Chris on
"Wayne King" <wmkingty(a)gmail.com> wrote in message <htoloe$luj$1(a)fred.mathworks.com>...
> "Chris " <chris.veinot(a)hotmail.com> wrote in message <htol1c$6ht$1(a)fred.mathworks.com>...
> > "Wayne King" <wmkingty(a)gmail.com> wrote in message <htokis$7k4$1(a)fred.mathworks.com>...
> > > "Chris " <chris.veinot(a)hotmail.com> wrote in message <htok3o$7a5$1(a)fred.mathworks.com>...
> > > > Hi,
> > > >
> > > > I have an excel sheet with sediment data ~1500 rows, each row is comprised of various data such as station id, lat, long, particle diameter etc. There are about 75 different stations and about 20 samples from each station. I am looking to calculate the average diameter in matlab of each station based on it's station id #. Thanks for the help.
> > >
> > > Hi Chris, have you read the data into Matlab using xlsread? It should be a simple matter of calculating the mean at that point.
> > >
> >
> > I'm fairly new to Matlab, but yes I can read the spreadsheet, I'm just not sure how to read specific colums and rows.
> > > Wayne
>
> I'm not sure I understand your data structure. When you say:
> "> I have an excel sheet with sediment data ~1500 rows, each row is comprised of various data such as station id, lat, long, particle diameter etc."
> Are you saying that each row is one kind of data, e.g. station id, or in each row do you have multiple measurements of different data, e.g. station id, lat, long, etc.
>
> You can also do File -> Import Data and Matlab will basically walk you through importing the data, including creating a variable based on a row or column header.
>
> Wayne

Each Row is comprised of data such as station id, lat, long, mean etc.. so each row contains multiple measurements of data
From: TideMan on
On May 29, 3:21 am, "Chris " <chris.vei...(a)hotmail.com> wrote:
> "Wayne King" <wmkin...(a)gmail.com> wrote in message <htoloe$lu...(a)fred.mathworks.com>...
> > "Chris " <chris.vei...(a)hotmail.com> wrote in message <htol1c$6h...(a)fred..mathworks.com>...
> > > "Wayne King" <wmkin...(a)gmail.com> wrote in message <htokis$7k...(a)fred..mathworks.com>...
> > > > "Chris " <chris.vei...(a)hotmail.com> wrote in message <htok3o$7a...(a)fred.mathworks.com>...
> > > > > Hi,
>
> > > > > I have an excel sheet with sediment data ~1500 rows, each row is comprised of various data such as station id, lat, long, particle diameter etc. There are about 75 different stations and about 20 samples from each station.  I am looking to calculate the average diameter in matlab of each station based on it's station id #.  Thanks for the help.
>
> > > > Hi Chris, have you read the data into Matlab using xlsread? It should be a simple matter of calculating the mean at that point.
>
> > > I'm fairly new to Matlab, but yes I can read the spreadsheet, I'm just not sure how to read specific colums and rows.
> > > > Wayne
>
> > I'm not sure I understand your data structure. When you say:
> >  "> I have an excel sheet with sediment data ~1500 rows, each row is comprised of various data such as station id, lat, long, particle diameter etc."
> > Are you saying that each row is one kind of data, e.g. station id, or in each row do you have multiple measurements of different data, e.g. station id, lat, long, etc.
>
> > You can also do File -> Import Data  and Matlab will basically walk you through importing the data, including creating a variable based on a row or column header.
>
> > Wayne
>
> Each Row is comprised of data such as station id, lat, long, mean etc.. so each row contains multiple measurements of data

You say you know all about xlsread, so what's the problem?
a=xlsread(xslfile);
Now, if your sediment size is in column 6, then guess what?
Matlab will have cleverly put it into column 6 in a.
So to get the mean, you would say mean(a(:,6))
From: Chris on
TideMan <mulgor(a)gmail.com> wrote in message <4dd7b08d-b4af-49c2-be12-f26b9b3ece20(a)42g2000prb.googlegroups.com>...
> On May 29, 3:21 am, "Chris " <chris.vei...(a)hotmail.com> wrote:
> > "Wayne King" <wmkin...(a)gmail.com> wrote in message <htoloe$lu...(a)fred.mathworks.com>...
> > > "Chris " <chris.vei...(a)hotmail.com> wrote in message <htol1c$6h...(a)fred.mathworks.com>...
> > > > "Wayne King" <wmkin...(a)gmail.com> wrote in message <htokis$7k...(a)fred.mathworks.com>...
> > > > > "Chris " <chris.vei...(a)hotmail.com> wrote in message <htok3o$7a...(a)fred.mathworks.com>...
> > > > > > Hi,
> >
> > > > > > I have an excel sheet with sediment data ~1500 rows, each row is comprised of various data such as station id, lat, long, particle diameter etc. There are about 75 different stations and about 20 samples from each station.  I am looking to calculate the average diameter in matlab of each station based on it's station id #.  Thanks for the help.
> >
> > > > > Hi Chris, have you read the data into Matlab using xlsread? It should be a simple matter of calculating the mean at that point.
> >
> > > > I'm fairly new to Matlab, but yes I can read the spreadsheet, I'm just not sure how to read specific colums and rows.
> > > > > Wayne
> >
> > > I'm not sure I understand your data structure. When you say:
> > >  "> I have an excel sheet with sediment data ~1500 rows, each row is comprised of various data such as station id, lat, long, particle diameter etc."
> > > Are you saying that each row is one kind of data, e.g. station id, or in each row do you have multiple measurements of different data, e.g. station id, lat, long, etc.
> >
> > > You can also do File -> Import Data  and Matlab will basically walk you through importing the data, including creating a variable based on a row or column header.
> >
> > > Wayne
> >
> > Each Row is comprised of data such as station id, lat, long, mean etc.. so each row contains multiple measurements of data
>
> You say you know all about xlsread, so what's the problem?
> a=xlsread(xslfile);
> Now, if your sediment size is in column 6, then guess what?
> Matlab will have cleverly put it into column 6 in a.
> So to get the mean, you would say mean(a(:,6))

Okay thanks, what I'm having trouble with though is figuring out how to take select data within the sheet and calculate the mean. I'm not looking to take the mean of all of the data but just of a single ID number which is only about 20 rows in a 1500 row work sheet. I need to do this for ~75 different ID numbers.
From: us on
"Chris " <chris.veinot(a)hotmail.com> wrote in message <hu06rc$k70$1(a)fred.mathworks.com>...
> TideMan <mulgor(a)gmail.com> wrote in message <4dd7b08d-b4af-49c2-be12-f26b9b3ece20(a)42g2000prb.googlegroups.com>...
> > On May 29, 3:21 am, "Chris " <chris.vei...(a)hotmail.com> wrote:
> > > "Wayne King" <wmkin...(a)gmail.com> wrote in message <htoloe$lu...(a)fred.mathworks.com>...
> > > > "Chris " <chris.vei...(a)hotmail.com> wrote in message <htol1c$6h...(a)fred.mathworks.com>...
> > > > > "Wayne King" <wmkin...(a)gmail.com> wrote in message <htokis$7k...(a)fred.mathworks.com>...
> > > > > > "Chris " <chris.vei...(a)hotmail.com> wrote in message <htok3o$7a...(a)fred.mathworks.com>...
> > > > > > > Hi,
> > >
> > > > > > > I have an excel sheet with sediment data ~1500 rows, each row is comprised of various data such as station id, lat, long, particle diameter etc. There are about 75 different stations and about 20 samples from each station.  I am looking to calculate the average diameter in matlab of each station based on it's station id #.  Thanks for the help.
> > >
> > > > > > Hi Chris, have you read the data into Matlab using xlsread? It should be a simple matter of calculating the mean at that point.
> > >
> > > > > I'm fairly new to Matlab, but yes I can read the spreadsheet, I'm just not sure how to read specific colums and rows.
> > > > > > Wayne
> > >
> > > > I'm not sure I understand your data structure. When you say:
> > > >  "> I have an excel sheet with sediment data ~1500 rows, each row is comprised of various data such as station id, lat, long, particle diameter etc."
> > > > Are you saying that each row is one kind of data, e.g. station id, or in each row do you have multiple measurements of different data, e.g. station id, lat, long, etc.
> > >
> > > > You can also do File -> Import Data  and Matlab will basically walk you through importing the data, including creating a variable based on a row or column header.
> > >
> > > > Wayne
> > >
> > > Each Row is comprised of data such as station id, lat, long, mean etc.. so each row contains multiple measurements of data
> >
> > You say you know all about xlsread, so what's the problem?
> > a=xlsread(xslfile);
> > Now, if your sediment size is in column 6, then guess what?
> > Matlab will have cleverly put it into column 6 in a.
> > So to get the mean, you would say mean(a(:,6))
>
> Okay thanks, what I'm having trouble with though is figuring out how to take select data within the sheet and calculate the mean. I'm not looking to take the mean of all of the data but just of a single ID number which is only about 20 rows in a 1500 row work sheet. I need to do this for ~75 different ID numbers.

well...
why not expand tm's solution and add a row-limit(?)...

rb=10;
re=30;
nc=6;
r=mean(a(rb:re,nc);

us