Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8821625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:54:09+00:00 2026-06-14T05:54:09+00:00

I have two arrays in matlab representing tracked points by two different methods. In

  • 0

I have two arrays in matlab representing tracked points by two different methods. In each array the first column contains the frame number, and columns two and three are the x, y coordinates. The tracks don’t necessarily start or finish at the same frame, but I want to compare the distances between tracks for any common frames.

My input data is something along the lines of:

d1 =              d2 = 
[ 130 50 20;      [ 128 48 17;
  131 50 21;        129 52 19;
  ...               ...
  195 70 36 ]       180 65 34 ]

I can find intersecting frame numbers using

commonFrames = intersect(d1(:,1), d2(:,1));

but I’m stuck on how to align these arrays (preferably without a for loop)?

I’d looking for an output along the lines of [frameNumber x1 y1 x2 y2] where x1, y1 are values from frame frameNumber of array d1, and x2, y2 are values from frame frameNumber of array d2.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T05:54:10+00:00Added an answer on June 14, 2026 at 5:54 am

    ‘intersect’ function has two additional output values: indices of common values in input arrays.

    Your script can be following:

    [commonFrames,ia,ib] = intersect(d1(:,1), d2(:,1));
    commonData = [commonFrames d1(ia,2:3) d2(ib,2:3)];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two arrays. The first array contains the sort order. The second array
I have two arrays. In each array I have objects with lots of properties
I have two arrays built while parsing a text file. The first contains the
I have two arrays, the first one contents numbers and the second one use
I have two arrays... $Name = array(a, b, c, d); $Value = array(1, 2,
I am comparing two binary arrays. I have an array where values can either
I have two arrays. The first is a set of keys: [476126287, 373653306, 294631223,
I have two arrays in Matlab say A = [1 4 89 2 67
I have two arrays of different size A and B. I am comparing A
I have two arrays. One is $categories which contains all categories retrieved from my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.