⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cordic.m

📁 算超越函数的cordic算法的matlab程序
💻 M
字号:
% function [angle]=cordic(xi,yi);%                     % Initialitation%     x = xi%     y = yi%     z = 0%     d = 1;%     zantes = 0;%     a = 0;          % Iterative factor% 	K = 0.6073;     %K Factor%    % x = K*x;% while a < 11        % Really only takes a half of this value get an 0.001 of error%                     % in cosine and sine values.%      if y >=0%         d=-1;%     else%         d=1;%      end%                      %This function is used to get the +1,-1 value, the sing function don?t%                      %perform d=1 if z=0.%     xantes=x;%      x=xantes-(y*d*(1/2^a))%       y=y+(xantes*d*(1/2^a))%    z=z-(d*(1024*atan(1/2^a)))% %     a=a+1;% end% % % cosine = x;% % sine = y;% angle=z;function [z0]=cordic(xi,yi,angle);                    % Initialitation    x = xi;    y = yi;    z = angle;    d = 1;    zantes = 0;    a = 0;          % Iterative factor	K = 0.6073;     %K Factor    %x = K*x;while a < 11      % Really only takes a half of this value get an 0.001 of error                    % in cosine and sine values.     if z >=0        d=1;     else        d=-1;     end                     %This function is used to get the +1,-1 value, the sing function don?t                    % perform d=1 if z=0.    xantes=x;     x=xantes-(y*d*(1/2^a))      y=y+(xantes*d*(1/2^a))   z=z-(d*(atan(1/2^a)))    a=a+1;end% cosine = x;% sine = y; K*x K*yz0=z;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -