Code Showing "Undefined function or variable 'q'. Error in test (line 66) if(c~=q) " error Please help
1 次查看(过去 30 天)
显示 更早的评论
Line 65 to 70 is shown below
for r=1:1:c
if(r~=q)
w=refweight*p(r)*1/p(q);
disp(w)
end
end
Why is it showing "Undefined function or variable 'q'. Error in test (line 66) if(c~=q) " ??
0 个评论
回答(1 个)
Chance
2013-11-15
From all that you've shown you never defined q as anything. Either variables being used must be defined and of same length (or one of them be a constant) before the logical test (~=,<=,ect) can be performed.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Hypothesis Tests 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!