![]() |
how to solve this error: "Subscript indices must either be real positive integers or logicals"?
<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> [url=https://stackoverflow.com/questions/59031365/how-to-solve-this-error-subscript-indices-must-either-be-real-positive-integer]More answer...[/url] |
所有时间均为北京时间。现在的时间是 21:22。 |
Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.