For Programmers: Free Programming Magazines  


Home > Archive > Matlab > December 2005 > how to locate common values between two cell arrays









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author how to locate common values between two cell arrays
Zhihua Li

2005-12-18, 7:58 am

hi netters,

suppose i have two cell arrays A and B:
A={"xyz";"yzc";"abc";"xml"}
B={"yzc";"abc"}

some (or all) of B's values can be found in A. i want to get the
positions of these common values in A. so in this case

C=[2,3]

how do i get C automatically by some function?

thanks a lot!
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com