Mohitkalra0207
Newbie level 3
Hello guys
I am trying to implement cordic algo for finding the final coordinate after specified rotation on matlab using the below mentioned code but I am not getting the required result.Can anyone please suggest me way out??would be very thankful to you.
I am trying to implement cordic algo for finding the final coordinate after specified rotation on matlab using the below mentioned code but I am not getting the required result.Can anyone please suggest me way out??would be very thankful to you.
Code Basic4GL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 xi=.6072 yi=0 q=[45 26.565 14.04 7.125 3.576 1.7899 .8951 .4476 .224 .112 .0558 ] angle=20 for i=0:1:10 if(angle>=0) s=1 else s=-1 end if(i==0) x(i+1)= xi - s*1*yi y(i+1)= yi + s*1*xi angle=angle - s*q(1) elseif(i<10) x(i+1)=x(i) - s*2^(-i)*y(i) y(i+1)=y(i) + s*2^(-i)*x(i) angle =angle - s*q(i) end end xcordinate=x(10) ycordinate=y(10)
Last edited by a moderator: