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: vectorization?
Replies: 5   Last Post: Aug 9, 1996 1:02 PM

Advanced Search

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

Posts: 13
Registered: 12/7/04
vectorization?
Posted: Aug 6, 1996 10:20 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I need to retrieve those elements that are shared in matrices
A en B without a time-consuming for-loop. Is it possible
to do this in one or two lines?
Example:
A=[1 6 9; 0 7 7; 2 8 2];
B=[0 9 7 3; 0 3 5 4];

answer= 0 9 7

In my case all elements are positive integers. An answer like
0 0 9 7 7 is no problem.


Thanks in advance!
Edwin

--


-----------------------------------------------------------------
-- Edwin Verheijen edwin@akst.tn.tudelft.nl --
------ Laboratory of Seismics and Acoustics phone: (+31 15)2782021 ------
-- Delft University of Technology The Netherlands --
-----------------------------------------------------------------





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.