Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
problem in reading data file

Subject: problem in reading data file

From: Poulomi

Date: 28 Sep, 2013 23:13:10

Message: 1 of 4

Hi,

I have a list of matrices, say A1, A2, ..., A100 in a folder, which contains 3 columns such as:
A = [0.84992 1 0.84992
6.9725 6 1.5011
12.081 8 1.8157
6.6061 5 1.4686
10.365 7 1.824
9.1929 5 2.694
2.0006 2 1.1182
29.837 20 2.4854
22.005 13 2.5415
3.2227 3 1.1925
0.86641 1 0.86641
]; I have another text file which contain a matrix Z of size (100 x 3) for each file A1...A100. I need to pick the associated value from Z matrix when the 2nd row value of each element of A's exceed 10, i.e., say A1(:,2) > 10. Let me know how i can solve this issue. Thanks,

Subject: problem in reading data file

From: dpb

Date: 29 Sep, 2013 00:19:22

Message: 2 of 4

On 9/28/2013 6:13 PM, Poulomi wrote:
> Hi,
>
> I have a list of matrices, say A1, A2, ..., A100 in a folder, which
> contains 3 columns such as:
> A = [0.84992 1 0.84992
> 6.9725 6 1.5011
> 12.081 8 1.8157
> 6.6061 5 1.4686
> 10.365 7 1.824
> 9.1929 5 2.694
> 2.0006 2 1.1182
> 29.837 20 2.4854
> 22.005 13 2.5415
> 3.2227 3 1.1925
> 0.86641 1 0.86641
> ]; I have another text file which contain a matrix Z of size (100 x 3)
> for each file A1...A100. I need to pick the associated value from Z
> matrix when the 2nd row value of each element of A's exceed 10, i.e.,
> say A1(:,2) > 10. Let me know how i can solve this issue. Thanks,

Read the arrays into memory -- either use a cell array or put them in a
3D array w/ 100 planes.

What, specifically, is "the associated value" from Z?

--

Subject: problem in reading data file

From: Pg

Date: 29 Sep, 2013 02:39:07

Message: 3 of 4

Each of this matrix have corresponding goodness of fit test value is present in Z-matrix. I need to check whether each A1(:,2) > 10 or not. If it is I need to pick that goodness of fit value from Z matrix and do further calculation. If not then I have to move to next matrix A2 and repeat the procedure, i.e., to check whether A2(:,2) > 10 or not and successively.





dpb <none@non.net> wrote in message <l27rmf$tq9$1@speranza.aioe.org>...
> On 9/28/2013 6:13 PM, Poulomi wrote:
> > Hi,
> >
> > I have a list of matrices, say A1, A2, ..., A100 in a folder, which
> > contains 3 columns such as:
> > A = [0.84992 1 0.84992
> > 6.9725 6 1.5011
> > 12.081 8 1.8157
> > 6.6061 5 1.4686
> > 10.365 7 1.824
> > 9.1929 5 2.694
> > 2.0006 2 1.1182
> > 29.837 20 2.4854
> > 22.005 13 2.5415
> > 3.2227 3 1.1925
> > 0.86641 1 0.86641
> > ]; I have another text file which contain a matrix Z of size (100 x 3)
> > for each file A1...A100. I need to pick the associated value from Z
> > matrix when the 2nd row value of each element of A's exceed 10, i.e.,
> > say A1(:,2) > 10. Let me know how i can solve this issue. Thanks,
>
> Read the arrays into memory -- either use a cell array or put them in a
> 3D array w/ 100 planes.
>
> What, specifically, is "the associated value" from Z?
>
> --

Subject: problem in reading data file

From: dpb

Date: 29 Sep, 2013 13:23:06

Message: 4 of 4

On 9/28/2013 9:39 PM, Pg wrote:

...[top posting repaired -- please don't do this: hard conversation
follow makes]...

> dpb <none@non.net> wrote in message <l27rmf$tq9$1@speranza.aioe.org>...
...

>> What, specifically, is "the associated value" from Z?
...

>> Each of this matrix have corresponding goodness of fit test value is
>> present in Z-matrix. I need to check whether each A1(:,2) > 10 or not.
>> If it is I need to pick that goodness of fit value from Z matrix and do
>> further calculation. If not then I have to move to next matrix A2 and
>> repeat the procedure, i.e., to check whether A2(:,2) > 10 or not and
>> successively.
>>

Sorry, I didn't mean "what" in terms of the functional as much as in
"what's the mechanism of 'associated with' of the values in Z?" Is it
the one in a position or are you looking for a particular value.

If it is positional and there's a one-to-one of the size(A1,2) to the
length(Z) then

ix=A1(:,2)>10;

is a logical array of TRUE/FALSE and

z=Z(ix);

returns those for which the value is TRUE.

Again, if you'll read the A data into a cell array or a 3D array, you
can likely do this all with cellfun() or arrayfun().

You do _NOT_ want to create some 100 or more different variables A1, A2,
..., etc., etc. That way "there be dragons".

--

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us