??? Attempted to access l(0); index must be a positive integer or logical.
显示 更早的评论
hi, all. i have a little problem here i use this code:
function y=iseng(x,d,n)
l=dec2bin(d);
k=length(l);
y=1;
for j=(k-1):-1:0
y= y*mod(y,n);
if l(j) == 1
y= y*mod(x,n);
end
end
but every-time i use that function it's return error: ??? Attempted to access l(0); index must be a positive integer or logical. Error in ==> iseng at 8 if l(j) == 1
anyone know my mistake??
采纳的回答
更多回答(1 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!