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!