Can anyone please help me to understand the problem here? I keep getting the error "Index exceeds matrix dimensions".
이전 댓글 표시
for i = 1:length(circles)
if (circles(i,1) ~= 0 & peaks(i,2) ~= 0)
xp = peaks(3,i).*cos(ang);
yp = peaks(3,i).*sin(ang);
end
end
채택된 답변
추가 답변 (2개)
Matt J
2012년 12월 26일
You've done something similar to the following,
>> x=1:5; a=x(6)
Andrei Bobrov
2012년 12월 26일
편집: Andrei Bobrov
2012년 12월 26일
if size(circles,1) == size(peaks,1)
dc = cellfun(@(f)f(ang).*peaks(3,circles(:,1) & peaks(:,2)),{@cos,@sin},'un',0);
[xp,yp] = dc{:};
end
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!