Problem 924. intersection of matrices
Given two matrices filled with ones and zeros, determine if they share a common row, column entry. These matrices are of identical size.
Examples:
Inputs A = [1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1 ]
and B = [0 1 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1
1 0 0 0 0 ]
Output tf is false
Inputs A = [1 1 1 0 1
1 1 1 1 0
0 1 1 1 1
1 0 1 1 1
1 1 0 1 1 ]
and B = [0 1 0 0 0
1 0 0 0 0
0 0 0 0 1
0 0 0 1 0
0 0 1 0 0]
Output tf is true
Solution Stats
Problem Comments
-
10 Comments
Show
7 older comments
Marco Riani
on 22 Jan 2022
A small addendum to the comment of Chien-Han Su
Just consider the problem to be "Is there any i, j such that A(i,j) == B(i,j) and A(i,j) or B(i,j) ~=0"
Jung Un Park
on 5 Jul 2023
Problem description is poor.
Olayinka
on 11 Nov 2023
Please explain this problem for further clarity
Solution Comments
Show commentsProblem Recent Solvers599
Suggested Problems
-
2762 Solvers
-
1027 Solvers
-
276 Solvers
-
We love vectorized solutions. Problem 1 : remove the row average.
832 Solvers
-
Given a square and a circle, please decide whether the square covers more area.
1212 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!