From: antonio ferreira on
Hi all.

I have a box with a longitudinal dimension of 10 meters. In the bottom of the box I have equilateral triangles (all sides are equal) (the triangles starts at x= 3 meters and end at x=7 meters).The configuration of the bottom is periodic:the first triangle starts at x=3 and has a base length of l, then there is an empty space of l/3, another triangle with l base length, empty space of l/3...and this configuration continues until x=7. From x=0 to x=3 and x=7 to x=10 there are no triangles.

I have to do an average of some variables along the height of the box (y) from x=3 to x=7 but I do not want to consider points y inside the triangles. I am not beeing able to do this in matlab.any suggestions?regards
From: Thomas Britton on
Can you create a mask for those points you want to include/exclude?

If so you can sample the data using that mask and perform your analaysis on the masked data.

i.e.

data=rand(5,5);

temp_mask=rand(5,5); %randomly create a mask, use a function to fit you rdata
mask=ones(5,5); %create a blank mask of ones.
mask(temp_mask < 0.5) = 0; %set those points within the mask to 0 when the temp_mask is less than 0.5

newdata=data(mask==1); %extract the data from the raw data set using your defined mask


"antonio ferreira" <edgar.acferreira(a)gmail.com> wrote in message <i173ms$88v$1(a)fred.mathworks.com>...
> Hi all.
>
> I have a box with a longitudinal dimension of 10 meters. In the bottom of the box I have equilateral triangles (all sides are equal) (the triangles starts at x= 3 meters and end at x=7 meters).The configuration of the bottom is periodic:the first triangle starts at x=3 and has a base length of l, then there is an empty space of l/3, another triangle with l base length, empty space of l/3...and this configuration continues until x=7. From x=0 to x=3 and x=7 to x=10 there are no triangles.
>
> I have to do an average of some variables along the height of the box (y) from x=3 to x=7 but I do not want to consider points y inside the triangles. I am not beeing able to do this in matlab.any suggestions?regards
From: antonio ferreira on
No, i think i am afraid not




"Thomas Britton" <benjamin.britton(a)materials.ox.ac.remove.uk> wrote in message <i174q8$g9h$1(a)fred.mathworks.com>...
> Can you create a mask for those points you want to include/exclude?
>
> If so you can sample the data using that mask and perform your analaysis on the masked data.
>
> i.e.
>
> data=rand(5,5);
>
> temp_mask=rand(5,5); %randomly create a mask, use a function to fit you rdata
> mask=ones(5,5); %create a blank mask of ones.
> mask(temp_mask < 0.5) = 0; %set those points within the mask to 0 when the temp_mask is less than 0.5
>
> newdata=data(mask==1); %extract the data from the raw data set using your defined mask
>
>
> "antonio ferreira" <edgar.acferreira(a)gmail.com> wrote in message <i173ms$88v$1(a)fred.mathworks.com>...
> > Hi all.
> >
> > I have a box with a longitudinal dimension of 10 meters. In the bottom of the box I have equilateral triangles (all sides are equal) (the triangles starts at x= 3 meters and end at x=7 meters).The configuration of the bottom is periodic:the first triangle starts at x=3 and has a base length of l, then there is an empty space of l/3, another triangle with l base length, empty space of l/3...and this configuration continues until x=7. From x=0 to x=3 and x=7 to x=10 there are no triangles.
> >
> > I have to do an average of some variables along the height of the box (y) from x=3 to x=7 but I do not want to consider points y inside the triangles. I am not beeing able to do this in matlab.any suggestions?regards