Subscripting into an empty matrix is not supported
2 views (last 30 days)
Show older comments
Hi There,
I have the following simple Matlab code, and I'm trying to implement the HDL code for it. but I got this error "Subscripting into an empty matrix is not supported" for "x(k+2)".
is there anyone could help me on that?
x=amp*sin(2*f*t);
k=1;
km=31416;
UPDN=zeros(1,km,'double');
for k=1:1:km-2;
if x(k+2)>=x(k);
UPDN(k)=1;
else
UPDN(k)=0;
end
end
for k=km-1:1:km;
UPDN(k)=1;
end
0 Comments
Accepted Answer
See Also
Categories
Find more on Logical 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!