From: AMK on
Can someone explain how to group data into a defined interval range for boxplots? For example, we have a 100x2 temperature matrix and we'd like to group the data into 2 degree non-overlapping intervals based on the first column. We can do it manually like this, but it's kind of clunky. Is there a more general solution?

[code]
x = [logger.data_b logger.data_e];
select1 = find( x(:,1) > min(x(:,1)) & x(:,1) < (min(x(:,1)+ 2 )) );
x1 = x(select1,:)
select2 = find( x(:,1) > min(x(:,1)+ 2.01) & x(:,1) < (min(x(:,1)+ 4 )) );
x2 = x(select2,:)
select3 = find( x(:,1) > min(x(:,1)+ 4.01) & x(:,1) < (min(x(:,1)+ 6 )) );
x3 = x(select3,:)
[/code]
From: us on
AMK <kennaster(a)gmail.com> wrote in message <228314146.21702.1277401001731.JavaMail.root(a)gallium.mathforum.org>...
> Can someone explain how to group data into a defined interval range for boxplots? For example, we have a 100x2 temperature matrix and we'd like to group the data into 2 degree non-overlapping intervals based on the first column. We can do it manually like this, but it's kind of clunky. Is there a more general solution?
>
> [code]
> x = [logger.data_b logger.data_e];
> select1 = find( x(:,1) > min(x(:,1)) & x(:,1) < (min(x(:,1)+ 2 )) );
> x1 = x(select1,:)
> select2 = find( x(:,1) > min(x(:,1)+ 2.01) & x(:,1) < (min(x(:,1)+ 4 )) );
> x2 = x(select2,:)
> select3 = find( x(:,1) > min(x(:,1)+ 4.01) & x(:,1) < (min(x(:,1)+ 6 )) );
> x3 = x(select3,:)
> [/code]

a hint:

help histc;

us