Info
この質問は閉じられています。 編集または回答するには再度開いてください。
type of variable "m" changes (i.e int or [ ] ) while running a program using different datasets
1 回表示 (過去 30 日間)
古いコメントを表示
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 ??
0 件のコメント
回答 (1 件)
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!