type of variable "m" changes (i.e int or [ ] ) while running a program using different datasets
Información
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Mostrar comentarios más antiguos
when i use a dataset : values of m,n,temp are integer and, i get results
but, when i use another dataset as input : value of m becomes an empty array [] , i cant figure out how ??
here the code
rankloss=0;
for i=1:num_instance
temp=0;
for m=1:Label_size(i)
for n=1:(num_class-Label_size(i))
if(Outputs(Label{i,1}(m),i)<=Outputs(not_Label{i,1}(n),i))
temp=temp+1;
end
end
end
*rl_binary(i)=temp/(m*n);
rankloss=rankloss+temp/(m*n);*
end
Label_size=zeros(1,num_instance); and
[num_class,num_instance]=size(Outputs); here.
so as a result i get this error
Error using / : Matrix dimensions must agree: temp/(m*n); (because m is [] )
i tried temp./(m.*n) but it obviously gives an empty array [] as a reult
note: both input datasets have same dimensions and same type , only data differs
i hoep my question is clear .... how can i figure out why m becomes [ ] instead of an integer value ??
Respuestas (1)
Chad Greene
el 18 de Mzo. de 2014
0 votos
Is Label_size defined before this bit of code?
1 comentario
pooja
el 18 de Mzo. de 2014
La pregunta está cerrada.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!