Why do I get the Error: Array indices must be positive integers or logical values.
Show older comments
Xtsparse = zeros(size(Xt));
l=0.;
help = size(Xt)*keep;
rounded = round(help);
while l<rounded
Xtsparse(l)=max(abs(Xt));
while r<size(Xt)
if(Xt(r)==max(abs(Xt)))
Xt(r)=0;
end
end
end
when using this Code and try it to Run i always get the Error "Array indices must be positive integers or logical values." in line "Xtsparse(l)=max(abs(Xt));"
Does anyone know, why this Error occurs?
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!