clc;tic;x=[ 1000 225 304 236 213 339 187 197 226225 1000 140 153 15 175 84 160 110304 140 1000 152 132 41 121 190 108236 153 152 1000 143 188 70 73 63213 15 132 143 1000 166 74 145 102339 175 41 188 166 1000 157 226 144187 84 121 70 74 157 1000 81 43197 160 190 73 145 226 81 1000 90226 110 108 63 102 144 43 90 1000]xnv=x;x1=x;minr= nnminr(x);[r c ] = size(x);for i=1:rfor j=1:cx(i,j)=x(i,j)/minr(i);endendx;minc=nnminr(x);for i=1:rfor j=1:cx(j,i)=x(j,i)/minc(i);endendx;count=0;for l=1:rfor i=1:rfor j=1:c if x(i,j)==1count = count+ 1;endendif count <= 1for I=ifor j=1:cif x(I,j)==1x(I,j)= x(I,j)*10;endfor i=1:r[yc yr] = find (x == 10);l = length(yc);for m=1:lx(yr(m),yc(m)) = 10;for j=1:cif x(yr(m),j) == 10x(yr(m),j)=0;endif x(j,yc(m)) == 10x(j,yc(m))=0;endendcontinueendx;endx;endendendcount=0;endendx;for i= 1:rfor j=1:cif x(i,j) == 0x(i,j)=1;endendendx;count=0;for i=1:rfor j=1:cif x(i,j)==1count = count+ 1;endendif count > 1for I=ifor j=1:cx(I,j)= x(I,j)*10;[yc yr] = find (x == 10,1);l = length(yc);for m=1:lx(yr(m),yc(m)) = 10;for j=1:cif x(yr(m),j) == 10x(yr(m),j)=0;endif x(j,yc(m)) == 10x(j,yc(m))=0;endendcontinueendx;endx;endendcount=0;x;for i= 1:rfor j=1:cif x(i,j) == 0x(i,j)=1;endendendx;z=xnv.*xMinvalue=(sum(sum(z)))plot(z)toc;
Please debug this code showing error as
Error: File: GA1.m Line: 77 Column: 1
At least one END is missing: the statement may begin here.
and how to conver function from nnmin to MIN()
Best Answer