Subscripting into an empty matrix is not supported
이전 댓글 표시
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
채택된 답변
추가 답변 (1개)
댓글 수: 3
Andrei Bobrov
2014년 9월 23일
편집: Andrei Bobrov
2014년 9월 23일
dero2 = dero;
dero2(conv2(diff(dero(:)),[1;1])==2) = 0;
or
dero2(strfind(diff(dero(:)),[1 1])+1) = 0;
Tamer
2014년 9월 24일
Tamer
2014년 9월 27일
카테고리
도움말 센터 및 File Exchange에서 Fixed Point Conversion Basics and Type Specification에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!