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

📄 rect2polar.m

📁 matlab programming for engineers(2nd)书籍源码,这是一本很好的学习MATLAB编程书
💻 M
字号:
function [r, theta] = rect2polar(x,y)
%RECT2POLAR Convert rectangular to polar coordinates 
% Function RECT2POLAR accepts the rectangular coordinates 
% (x,y) and converts them into the polar coordinates
% (r,theta), where theta is expressed in degrees.
%
% Calling sequence:
%   [r, theta] = rect2polar(x,y)

% Define variables:
%   r        -- Length of polar vector
%   theta    -- Angle of vector in degrees
%   x        -- x-position of point
%   y        -- y-position of point

%  Record of revisions:
%      Date       Programmer          Description of change
%      ====       ==========          =====================
%    02/01/07    S. J. Chapman        Original code 

r = sqrt( x.^2 + y .^2 );
theta = 180/pi * atan2(y,x);

⌨️ 快捷键说明

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