Problem 42502. Combine Data With Gaps
Combine data sets a and b where the datasets have "gaps" or unique points.
Example:
Input
a = [1,0;
2,1;
3,5;
5,2;
6,3];
b = [1,2;
3,6;
4,3;
6,4]
Output
d = [1,0,2;
2,1,0;
3,5,6;
4,0,3;
5,2,0;
6,3,4];
Where d is the combination of a and b.
Where there are gaps in a and b, there should be zeros in the resulting matrix.
Solution Stats
Problem Comments
-
3 Comments
Peng Liu
on 10 Aug 2015
You test suite should be corrected as
assert(isequal(comb_gap(a,b),d_correct))
Monica Roberts
on 10 Aug 2015
Thanks for the correction
Asif Newaz
on 17 Apr 2020
ur problem description is quite vague
Solution Comments
Show commentsProblem Recent Solvers46
Suggested Problems
-
Remove all the words that end with "ain"
2445 Solvers
-
Cell Counting: How Many Draws?
2147 Solvers
-
Change the sign of even index entries of the reversed vector
577 Solvers
-
48 Solvers
-
Given a square and a circle, please decide whether the square covers more area.
1252 Solvers
More from this Author1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!