poster
2019-11-25, 20:00
<p>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.</p>
<pre><code>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
</code></pre>
<p>I found this error "Subscript indices must either be real positive integers or logicals" for this line:</p>
<pre><code> t(i,j)=fChebyshevDist(data(:,i),data(:,j));
</code></pre>
<p>that I really haven't got any idea to solve. I'll be very grateful to have your opinions. Thanks</p>
More answer... (https://stackoverflow.com/questions/59031365/how-to-solve-this-error-subscript-indices-must-either-be-real-positive-integer)
<pre><code>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
</code></pre>
<p>I found this error "Subscript indices must either be real positive integers or logicals" for this line:</p>
<pre><code> t(i,j)=fChebyshevDist(data(:,i),data(:,j));
</code></pre>
<p>that I really haven't got any idea to solve. I'll be very grateful to have your opinions. Thanks</p>
More answer... (https://stackoverflow.com/questions/59031365/how-to-solve-this-error-subscript-indices-must-either-be-real-positive-integer)