Combine Data With Gaps - MATLAB Cody - MATLAB Central

Problem 42502. Combine Data With Gaps

Difficulty:Rate
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

36.55% Correct | 63.45% Incorrect
Last Solution submitted on Apr 03, 2025

Problem Comments

Solution Comments

Show comments
Registration Now Open for MathWorks AUTOMOTIVE CONFERENCE 2025
...
Hello Community, We're excited to announce that registration is now open for the...

Problem Recent Solvers46

Suggested Problems

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!
Go to top of page