Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
xcorr2 Data Location

Subject: xcorr2 Data Location

From: Matt

Date: 30 Jul, 2010 15:35:20

Message: 1 of 1

Hello,

I am having a bit of difficulty with the xcorr2 command, and getting the to locate my data in the correct place..

Currently, I have a large matrix (Dg) which was (4320 x 8640) of data. From it, I took a subset of data, from (1920:2161,5761) and called it GA. I know this data is exact, I have put them side by side, and truth checked them with '==' so their numbers are exact.

From there, I did

'g = xcorr2(Dg,GA);

%g = g/max(max(g));

[I,J]= find(g == max(g(:)))'

(the second line is % because I took it out to see if there was any difference, there was not)

The point I should get, I believe, is something along the lines of (2040,5761). However, the [I, J] I get back is (2854, 6929). I have flip flopped the GA and Dg in their position of of xcorr2, but the other way around produces data further off the mark.

I've tried my program there with smaller sets of data, like a 3x3 and a 2x1 matrix, but it still gives me not the correct points.

Any help would be great, thank you!

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us