From: Reff on
I have done train data by using neural network. When i want to test the image by, it shows the error.

??? Subscript indices must either be real positive integers or logicals.

Error in ==> test_data at 112
xnor(i,j) = ((0.8/d(j))*(x_un_nor(i,j) - xmin(j)) + 0.1);

This is my program after feature extraction.

F=svd(double(BW))
xlswrite('data_1.xls',F);
% normalise
x_unor = xlsread('data_1.xls');
% x_un_nor = xlsread('output.xls');
% x_un_nor=s;
%[m,n] = size(x_un_nor);
xmax = max(x_unor);
xmin = min(x_unor);
d = xmax - xmin;
% for i= 1:m
% for j = 1:n
xnor(i,j) = ((0.8/d(j))*(x_un_nor(i,j) - xmin(j)) + 0.1);
% end
% end

%[np ni] = size(p1);
xlswrite('xnor.xls',p);
p =xnor' ;%p1';
load nete92 net %highest percent of NN
a = sim(net,p);
toc
m1 = a(1);
ind = 1;
for i = 1:16
if (a(i)> m1)
m1 = a(i);
ind = i;
end
end

Thanks
From: Steven Lord on

"Reff " <rafi128(a)yahoo.com> wrote in message
news:hrbse1$e2o$1(a)fred.mathworks.com...
>I have done train data by using neural network. When i want to test the
>image by, it shows the error.
>
> ??? Subscript indices must either be real positive integers or logicals.
>
> Error in ==> test_data at 112
> xnor(i,j) = ((0.8/d(j))*(x_un_nor(i,j) - xmin(j)) + 0.1);
>
> This is my program after feature extraction.
>
> F=svd(double(BW))
> xlswrite('data_1.xls',F);
> % normalise x_unor = xlsread('data_1.xls');
> % x_un_nor = xlsread('output.xls');
> % x_un_nor=s;
> %[m,n] = size(x_un_nor);
> xmax = max(x_unor);
> xmin = min(x_unor);
> d = xmax - xmin;
> % for i= 1:m
> % for j = 1:n
> xnor(i,j) = ((0.8/d(j))*(x_un_nor(i,j) - xmin(j)) + 0.1);

Assuming i and j haven't been defined prior to this code, since the FOR
loops are commented out, this code attempts to use the sqrt(-1)st elements
of d and xmin along with element (sqrt(-1), sqrt(-1)) of x_un_nor to compute
a value and store it in element (sqrt(-1), sqrt(-1)) of xnor. There are no
such elements of a matrix in MATLAB.

*snip*

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ