vars.m

来自「matlab 多参数积分工具箱 multivariable calculus」· M 代码 · 共 25 行

M
25
字号
function [x,y,z,xs,ys,zs]=vars(f)
%VARS  Extract coordinates from function.
%   [X,Y,Z,XS,YS,ZS] = VARS(F) where F can be either a scalar or a vector function.
%   X, Y and Z are the strings containing either 'x', 'y' and 'z', or
%   'R', 'theta' and 'phi', or 'r', 'phi' and 'z' depending on what coordinates
%   the function F are currently using. XS, YS and ZS contains required amount of spaces
%   for indenting the functions right.
%   This function is used internally by the classes SCALAR and VECTOR.
%
%   See also TYPE.

% Copyright (c) 2001-04-22, B. Rasmus Anthin

switch(type(f))
case 'cart'
   x='x';y='y';z='z';
   xs='';zs='';
case 'sph'
   x='R';y='theta';z='phi';
   xs(1:4)=' ';zs(1:2)=' ';
case 'cyl'
   x='r';y='phi';z='z';
   xs(1:2)=' ';zs(1:2)=' ';
end
ys='';

⌨️ 快捷键说明

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