Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: data extraction from matrix to use in another matrix
Replies: 26   Last Post: Oct 22, 2013 4:57 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
dpb

Posts: 8,182
Registered: 6/7/07
Re: data extraction from matrix to use in another matrix
Posted: Oct 21, 2013 12:28 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 10/21/2013 8:34 AM, dpb wrote:
> On 10/21/2013 6:45 AM, walter Mulvany wrote:
>> Elem # Nodea Nodeb Nodeax Nodeay
>> 1 4 2 6 0
>> 2 2 3 2 0
>> 3 3 4 4 0
>> 4 4 7 6 0
>> 5 3 7 4 0
>>
>> You are right, element 1 should be (6 0), not (0 0), that was a typo,
>> all the others are correct.

>
> So, it was correct as written...
>

> >> for i=1:length(conn),M(i,:)=[conn(i,:) Node(conn(i,1),:)];end
> >> M

> M =
> 4 2 6 0
> 2 3 2 0
> 3 4 4 0
> 4 7 6 0
> 3 7 4 0

...

Note, however, if you are looking for the is the location for which the
node is the _value_, the general idea still works but you need another
level of indirection to return the index of the location of a given
value...consider

M(i,:)=[conn(i,:) Node(find(Node(:,1)==conn(i,1)),:)];

and "salt to suit". I'm still not sure which it is you're trying to
build actually...but the former above reproduces the sample output; I'm
just not positive that's the output you need for the purpose.

--



Date Subject Author
10/19/13
Read data extraction from matrix to use in another matrix
walter Mulvany
10/19/13
Read Re: data extraction from matrix to use in another matrix
dpb
10/19/13
Read Re: data extraction from matrix to use in another matrix
walter Mulvany
10/19/13
Read Re: data extraction from matrix to use in another matrix
dpb
10/19/13
Read Re: data extraction from matrix to use in another matrix
walter Mulvany
10/20/13
Read Re: data extraction from matrix to use in another matrix
dpb
10/20/13
Read Re: data extraction from matrix to use in another matrix
walter Mulvany
10/20/13
Read Re: data extraction from matrix to use in another matrix
dpb
10/20/13
Read Re: data extraction from matrix to use in another matrix
walter Mulvany
10/21/13
Read Re: data extraction from matrix to use in another matrix
walter Mulvany
10/21/13
Read Re: data extraction from matrix to use in another matrix
dpb
10/21/13
Read Re: data extraction from matrix to use in another matrix
dpb
10/21/13
Read Re: data extraction from matrix to use in another matrix
walter Mulvany
10/21/13
Read Re: data extraction from matrix to use in another matrix
dpb
10/21/13
Read Re: data extraction from matrix to use in another matrix
walter Mulvany
10/22/13
Read Re: data extraction from matrix to use in another matrix
walter Mulvany
10/22/13
Read Re: data extraction from matrix to use in another matrix
dpb
10/22/13
Read Re: data extraction from matrix to use in another matrix
walter Mulvany
10/22/13
Read Re: data extraction from matrix to use in another matrix
walter Mulvany
10/22/13
Read Re: data extraction from matrix to use in another matrix
dpb
10/22/13
Read Re: data extraction from matrix to use in another matrix
walter Mulvany
10/22/13
Read Re: data extraction from matrix to use in another matrix
dpb
10/22/13
Read Re: data extraction from matrix to use in another matrix
dpb
10/22/13
Read Re: data extraction from matrix to use in another matrix
walter Mulvany
10/22/13
Read Re: data extraction from matrix to use in another matrix
dpb
10/22/13
Read Re: data extraction from matrix to use in another matrix
dpb
10/20/13
Read Re: data extraction from matrix to use in another matrix
dpb

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.