I wrote this program for computing the average of the distance between each feature and the rest of the features in the colon dataset. I defined a function for computing Chebyshev distance.
close all;
clc
load colon.mat
data=colon;
[n,m]=size(data);
for i=1:m-1
for j=i+1:m
t(i,j)=fChebyshevDist(data(:,i),data(:,j));
b=sum(t)/(m-1);
end
end
function [ fchd ] = fChebyshevDist(p,q)
fchd=max(abs(p-q));
end
I found this error "Subscript indices must either be real positive integers or logicals" for this line:
t(i,j)=fChebyshevDist(data(:,i),data(:,j));
that I really haven't got any idea to solve. I'll be very grateful to have your opinions. Thanks
More answer...