该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

function [r,h] = simple(s,varargin)

%SIMPLE Search for simplest form of a symbolic expression or matrix.

% SIMPLE(S) tries several different algebraic simplifications of

% S, displays any which shorten the length of S's representation,

% and returns the shortest. S is a SYM. If S is a matrix, the result

% represents the shortest representation of the entire matrix, which is

% not necessarily the shortest representation of each individual element.

%

% [R,HOW] = SIMPLE(S) does not display intermediate simplifications,

% but returns the shortest found, as well as a string describing

% the particular simplification. R is a SYM. HOW is a string.

%

% SIMPLE(S,'IgnoreAnalyticConstraints',VAL) controls the level of

% mathematical rigor to use on the analytical constraints while simplifying

% (branch cuts, division by zero, etc). The options for VAL are TRUE or

% FALSE. Specify TRUE to relax the level of mathematical rigor

% in the rewriting process. The default is FALSE.

%

%

% Examples:

%

% S R How

%

% cos(x)^2+sin(x)^2 1 simplify

% 2*cos(x)^2-sin(x)^2 3*cos(x)^2-1 simplify

% cos(x)^2-sin(x)^2 cos(2*x) simplify

% cos(x)+i*sin(x) exp(i*x) rewrite(exp)

% (x+1)*x*(x-1) x^3-x simplify(100)

% x^3+3*x^2+3*x+1 (x+1)^3 simplify

% cos(3*acos(x)) 4*x^3-3*x simplify(100)

%

% simple(asin(sin(x))) = asin(sin(x))

% simple(asin(sin(x)),'IgnoreAnalyticConstraints',true) = x

%

% See also SYM/SIMPLIFY, SYM/FACTOR, SYM/EXPAND, SYM/COLLECT.

% Copyright 1993-2011 The MathWorks, Inc.

if builtin('numel',s) ~= 1, s = normalizesym(s); end

p = nargout == 0;

[rsym,h] = mupadSimple(s,p,varargin{:});

r = privResolveOutput(rsym, s);

end

function [r,h] = mupadSimple(s,p,varargin)

h = '';

r = s;

x = symvar(s,1);

% parse arguments: Look for options

narg = nargin - 2;

args = varargin;

% default:

options = 'null()';

k = 1;

while k <= size(args, 2)

v = args{k};

if ischar(v) && strcmp(v, 'IgnoreAnalyticConstraints')

if k == size(args, 2);

error(message('symbolic:sym:optRequiresArg', v))

end

value = args{k+1};

if value == true

value = 'TRUE';

elseif value == false

value = 'FALSE';

elseif strcmp(v, 'IgnoreAnalyticConstraints') && isa(value, 'char')

if strcmp(value, 'all')

value = 'TRUE';

elseif strcmp(value, 'none')

value = 'FALSE';

else

error(message('symbolic:sym:badArgForOpt', v))

end

else

error(message('symbolic:sym:badarg', value))

end

options = [options ', ' v '=' value]; %#ok

args(k:k+1) = [];

else

error(message('symbolic:sym:badarg', v))

end

end

% Try the different simplifications.

[r,h] = simpler('simplify',s,r,h,p,options);

[r,h] = simpler('radsimp',s,r,h,p,'null()');

[r,h] = simpler('symobj::simplify',s,r,h,p,options,'100');

[r,h] = simpler('combine',s,r,h,p,options,'sincos');

[r,h] = simpler('combine',s,r,h,p,options,'sinhcosh');

[r,h] = simpler('combine',s,r,h,p,options,'ln');

[r,h] = simpler('factor',s,r,h,p,'null()');

[r,h] = simpler('expand',s,r,h,p,options);

[r,h] = simpler('combine',s,r,h,p,options);

[r,h] = simpler('rewrite',s,r,h,p,'null()','exp');

[r,h] = simpler('rewrite',s,r,h,p,'null()','sincos');

[r,h] = simpler('rewrite',s,r,h,p,'null()','sinhcosh');

[r,h] = simpler('rewrite',s,r,h,p,'null()','tan');

[r,h] = simpler('symobj::mwcos2sin',s,r,h,p,'null()');

if ~isempty(x)

[r,h] = simpler('collect',s,r,h,p,'null()',x);

end

end

function [r,h] = simpler(how,s,r,h,p,options,x)

%SIMPLER Used by SIMPLE to shorten expressions.

% SIMPLER(HOW,S,R,H,P,X) applies method HOW with optional parameter X

% to expression S, prints the result if P is nonzero, compares the

% length of the result with expression R, which was obtained with

% method H, and returns the shortest string and corresponding method.

if nargin < 7

[t,err] = mupadmex('symobj::map',s.s,how,options);

elseif ischar(x)

[t,err] = mupadmex('symobj::map',s.s,how,x,options);

else

[t,err] = mupadmex('symobj::map',s.s,how,x.s,options);

end

if err

return;

end

if nargin == 7

how = [how '(' char(x) ')'];

end

how = strrep(how,'symobj::','');

if p

loose = isequal(get(0,'FormatSpacing'),'loose');

if loose, disp(' '), end

disp([how ':'])

if loose, disp(' '), end

disp(t)

end

cmp = mupadmex('symobj::simpler', t.s, r.s, 0);

if strcmp(cmp,'TRUE')

r = t;

h = how;

end

end

matlab 中simple什么意思,[求助]Matlab2016b里没有simple函数相关推荐

  1. matlab中simple是什么函数,[求助]Matlab2016b里没有simple函数

    该楼层疑似违规已被系统折叠 隐藏此楼查看此楼 function [r,h] = simple(s,varargin) %SIMPLE Search for simplest form of a sym ...

  2. matlab simplify,[求助]Matlab2016b里没有simple函数

    该楼层疑似违规已被系统折叠 隐藏此楼查看此楼 function [r,h] = simple(s,varargin) %SIMPLE Search for simplest form of a sym ...

  3. matlab simplify函数,[求助]Matlab2016b里没有simple函数

    该楼层疑似违规已被系统折叠 隐藏此楼查看此楼 function [r,h] = simple(s,varargin) %SIMPLE Search for simplest form of a sym ...

  4. matlab子函数调用变量,matlab中,怎么样用function自定义函数调用另一个函数名为输入?...

    点击查看matlab中,怎么样用function自定义函数调用另一个函数名为输入?具体信息 答:test定义两个参数,一个是函数,一个是函数的变量. function [z]=test11(funna ...

  5. Matlab中的特殊函数使用(合流超几何函数、Kummer函数、贝塞尔函数等)

    matlab对于特殊函数的支持和说明并不向mathematica那样灵活详细,功能也逊色一些,但对于工科生而言基本是够用了,下面做一些总结. 合流超几何函数(Confluent hypergeomet ...

  6. matlab中非0即1函数,matlab 中统计一个数组中非零元素个素的函数名称是什么?

    可以自己写一个函数用来给数组排序.或者用MATLAB自带的 Matlab 用sort函数排序 二维数组2008-09-14 22:51在Matlab中排序某个向量(一维)时,可以使用sort(A),其 ...

  7. matlab中根据信号和信噪比添加高斯白噪声(函数直接使用)

    matlab中根据信号和信噪比添加高斯白噪声: function [y,noise] = Gnoisegen(x,snr) % Gnoisegen函数是叠加高斯白噪声到语音信号x中 % [y,nois ...

  8. Matlab中format rat的意思(补充说明format函数用法)

    format rat :使用分数来表示数值 例如 >> a=0.25a = 0.2500>> format rat>> aa =1/4 补充说明MATLAB中for ...

  9. matlab中的round、ceil、floor、fix函数

    在matlab中,round.ceil.floor.fix都是取整函数函数, round函数是个四舍五入函数,例:round(2.7)=3; round(1.2)=1; round(-1.3)=-1 ...

最新文章

  1. 关于数据库group by需要注意
  2. 算法转换c语言程序,(转)C语言实现卡尔曼滤波算法程序
  3. MyEclipse配置TomCat环境(图文详解)
  4. SQL Server数据行的物理空间分配
  5. 一、ssh 协议:SSH 传输层协议
  6. Day11 JaseSE File类的使用
  7. 基于JQUERY的WEB在线流程图设计器GOOFLOW 0.5版
  8. 微信头像制作小程序源码 微信流量主系列
  9. 怎么查看电脑是不是禁ping_电脑ping怎么打开怎么检测网络连接是否正常 ping网络教程...
  10. 政府行业数据保护方案
  11. CC2530+RFX2401启用功放过程小结
  12. SequoiaDB巨杉数据库成为唯一入选 “硅谷2016 大数据地形图”中国厂商, 企业级市场超越MongoDB等海外产品...
  13. 华钜同创:亚马逊开店六个日常运营小技巧
  14. ubuntu如何查看当前的ROS发行版本
  15. 桌面计算机 回收站图标,如何在计算机桌面上还原回收站图标?
  16. IP数据包传输的完整过程
  17. 常见的关系型数据库和非关系型数据库区别
  18. 企业官网建设需要多少钱
  19. NLP分词与词频实现
  20. Unity中实现批量替换字符串中的指定字符

热门文章

  1. C语言计算圆柱的表面积 体积
  2. 创建Python Pyramid 单文件 Web 应用程序
  3. Windows下安装Python pyramid,并运行一个pyramid的Helloworld项目
  4. python基础教程目录,从入门到上手的
  5. 算法为屠龙刀,设计模式为倚天剑
  6. CANopen移植步骤和ESD编辑器安装方式
  7. UTL_FILE包详解
  8. 博图无法链接plc下载程序 设置选择网卡
  9. 腾讯徐春明:互联网金融行业HBase实践与创新
  10. 华为人力资源管理经典大全