?? direction.m
字號:
%% description
% In order to find the right direction to rotate, this
% program was provided.According to the algorithm, it's
% much too easy to choose di. However, this file was
% provided separately to make the structure of the
% program clear.
% inputs/outputs refer to cordic.m,while dv_name denotes
% the name of the decision variable
%% code
function di=direction(dv,dv_name)
% check the No. of inputs
if(nargin<2)
dv_name='z'; % default decision variable:z
end
% main code section
di=1;
if(dv_name=='x' || dv_name=='y' || dv_name=='z')
% main code section
if(dv_name=='z') % z is decision variable
if(dv<0) di=-1; end
else % x/y is decision variable
if(dv>=0) di=-1; end
end
else printf('Wrong decision name!\n');
end
%end of function
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -