Calculating the distance between two matrices Matlab
Show older comments
I want to calculate the distance between two different DFT results after i performed this code:
I1 = imread('sample1');%read the images
I2 = imread('sample2');
GI1 = rgb2gray(I1) %change it to grayscale
GI2 = rgb2gray(I2)
DftR1 = DFT(GI1) %perform the 2-dimensional DFT(a function that i built it myself)
DftR2 = DFT(GI2)
so far it all worked; however when i want to compare the results of the DFT using this code:
Distance = pdist2(DftR1, DftR2)
I get this particular error: Error using pdist2 (line 224) PDIST2 does not accept complex data for built-in distances.
Accepted Answer
More Answers (1)
Deepesh B
on 2 Dec 2014
Hi U have to use
abs
before applying
pdist2
because after fft it will have complex numbers
Categories
Find more on Spectral Estimation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!