I have read CFD contaminant data into Matlab. I would like
to reduce the size of that data by finding groups of points
with similar concentrations. Is there a command for finding
like elements in a matrix? Please help, thanks!
Subject: Reducing matrix size by finding similar elements
"Lisa Chen" <yhc22@drexel.edu> wrote in message
<fm64na$53s$1@fred.mathworks.com>...
> I have read CFD contaminant data into Matlab. I would
like
> to reduce the size of that data by finding groups of
points
> with similar concentrations. Is there a command for
finding
> like elements in a matrix? Please help, thanks!
Could you provide a bit more detail? I don't anything about
CFD -- could you just give, say, an example of a 5x5 matrix
with a before and after shot? Say you want to turn:
"Ian Clarkson" <ian.clarkson@gesturetek.com> wrote in message
<fm65km$o1h$1@fred.mathworks.com>...
> "Lisa Chen" <yhc22@drexel.edu> wrote in message
> <fm64na$53s$1@fred.mathworks.com>...
> > I have read CFD contaminant data into Matlab. I would
> like
> > to reduce the size of that data by finding groups of
> points
> > with similar concentrations. Is there a command for
> finding
> > like elements in a matrix? Please help, thanks!
>
> Could you provide a bit more detail? I don't anything about
> CFD -- could you just give, say, an example of a 5x5 matrix
> with a before and after shot? Say you want to turn:
>
> [1 2 2.0001 3] -> [1 2 3]
>
> Is that what you mean by finding like elements?
>
> If that's the case, maybe something like:
>
> >>data=[1.83 2.845 2.001 3.2343 3.24 3.25 3.26];
> >>roundData=round(data/0.1)*0.1; % rounds to nearest tenth
> >>unique(roundData)
> ans =
> 1.8000 2.0000 2.8000 3.2000 3.3000
Suppose D is the number of accurate digits, you can also do
this by using vpa function
"Anh Huy Phan" <phananhhuy@mathworks.com> wrote in message
<fm7gdg$km0$1@fred.mathworks.com>...
> "Ian Clarkson" <ian.clarkson@gesturetek.com> wrote in
message
> <fm65km$o1h$1@fred.mathworks.com>...
> > "Lisa Chen" <yhc22@drexel.edu> wrote in message
> > <fm64na$53s$1@fred.mathworks.com>...
> > > I have read CFD contaminant data into Matlab. I would
> > like
> > > to reduce the size of that data by finding groups of
> > points
> > > with similar concentrations. Is there a command for
> > finding
> > > like elements in a matrix? Please help, thanks!
> >
> > Could you provide a bit more detail? I don't anything
about
> > CFD -- could you just give, say, an example of a 5x5
matrix
> > with a before and after shot? Say you want to turn:
> >
> > [1 2 2.0001 3] -> [1 2 3]
> >
> > Is that what you mean by finding like elements?
> >
> > If that's the case, maybe something like:
> >
> > >>data=[1.83 2.845 2.001 3.2343 3.24 3.25 3.26];
> > >>roundData=round(data/0.1)*0.1; % rounds to nearest
tenth
> > >>unique(roundData)
> > ans =
> > 1.8000 2.0000 2.8000 3.2000 3.3000
>
>
> Suppose D is the number of accurate digits, you can also
do
> this by using vpa function
>
> >> data=[1.83 2.845 2 2.001 3.2343 3.24 3.25 3.26]
> >> d = 2;
> >> double(unique(vpa(data,d)))
>
> ans =
>
> 1.8000 2.0000 2.8000 3.2000 3.3000
>
>
> >> d = 3;
> >> double(unique(vpa(data,d)))
>
> ans =
>
> 1.8300 2.0000 2.8400 3.2300 3.2400
> 3.2500 3.2600
>
>
> Anh Huy Phan
> RIKEN - BSI
>
>
Subject: Reducing matrix size by finding similar elements
"Ian Clarkson" <ian.clarkson@gesturetek.com> wrote in
message <fm65km$o1h$1@fred.mathworks.com>...
> "Lisa Chen" <yhc22@drexel.edu> wrote in message
> <fm64na$53s$1@fred.mathworks.com>...
> > I have read CFD contaminant data into Matlab. I would
> like
> > to reduce the size of that data by finding groups of
> points
> > with similar concentrations. Is there a command for
> finding
> > like elements in a matrix? Please help, thanks!
>
> Could you provide a bit more detail? I don't anything
about
> CFD -- could you just give, say, an example of a 5x5
matrix
> with a before and after shot? Say you want to turn:
>
> [1 2 2.0001 3] -> [1 2 3]
>
> Is that what you mean by finding like elements?
>
> If that's the case, maybe something like:
>
> >>data=[1.83 2.845 2.001 3.2343 3.24 3.25 3.26];
> >>roundData=round(data/0.1)*0.1; % rounds to nearest tenth
> >>unique(roundData)
> ans =
> 1.8000 2.0000 2.8000 3.2000 3.3000
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Disclaimer prior to use.