matlab simplify,[求助]Matlab2016b里沒有simple函數

該樓層疑似違規已被系統折疊?隱藏此樓查看此樓

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

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/395627.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/395627.shtml
英文地址,請注明出處:http://en.pswp.cn/news/395627.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

網龍面試后多久有回應_回應面試問題

網龍面試后多久有回應For the record, asking someone these questions probably isn’t the best way to get a deep understanding of their experience with React. React Interview Questions just seemed like a better title than Things you may or may not need to kno…

Bagging與隨機森林算法原理小結

在集成學習原理小結中&#xff0c;我們講到了集成學習有兩個流派&#xff0c;一個是boosting派系&#xff0c;它的特點是各個弱學習器之間有依賴關系。另一種是bagging流派&#xff0c;它的特點是各個弱學習器之間沒有依賴關系&#xff0c;可以并行擬合。本文就對集成學習中Bag…

iOS:多線程技術GCD的使用

GCD的使用&#xff1a; 1.隊列的類型1.1 主隊列&#xff1a;mian queue,主線程隊列,負責更行UI的操作。是一個串行的隊列。1.2 系統默認的并行隊列&#xff1a;global queue&#xff0c;按優先級分類。1.3 自定義的隊列&#xff1a;可以創建串行隊列或者是并行的隊列2.任務2.1 …

java什么叫一致性,java-順序一致性易失性說明

我正在從Java Jpoint會議觀看視頻.我對以下來自Alexey Shipilev報告的幻燈片有疑問&#xff1a;打擾一下,請不要打擾我.實際上,作者說不可能將變量集設置為r1 1 (Y)r2 0 (x)r3 1 (x)r4 0 (Y)根據視頻,他暗示很明顯.有人可以澄清為什么JMM無法設置此值嗎&#xff1f;附言如果…

模塊制作標準說明

原則一&#xff1a;CSS定義越少越好原則二&#xff1a;進來用<ul><li>等簡單的HTML代碼結構原則三&#xff1a;命名盡可能用CSS偽類原則四&#xff1a;一個模塊CSS名稱不能超過三個需要改正的寫法&#xff1a; <div class"fenglei"><div class&…

【c++】string類的使用

目錄 一、標準庫中的string類 1、簡單介紹string類 2、string類的常用接口注意事項 2.1、string類對象的常用構造 2.2、string類對象的容量操作 2.3、string類對象的訪問及遍歷操作 2.4、string類對象的修改操作 二、string類的模擬實現 一、標準庫中的string類 1、簡…

拜托了

by Buddy Reno由Buddy Reno Git Please &#xff1a;如何在不做蠢事的情況下強行推動 (Git Please: how to force push without being a jerk) As the size of a dev team grows, so does the likelihood of someone doing a force push and overwriting someone else’s code…

性能測試類型

1.驗收性能測試 驗收性能測試&#xff08;Acceptance Performance Testing&#xff09;方法通過模擬生產運行的業務壓力量和使用場景組合&#xff0c;測試系統的性能是否滿足生產性的要求。通俗的說&#xff1a;在特定的運行條件下驗證系統的能力狀況。 &#xff08;1&#xff…

Java - 對象(object) 具體解釋

對象(object) 具體解釋 本文地址: http://blog.csdn.net/caroline_wendy/article/details/24059545 對象(object)的實例能夠是 物理對象(如 人, 車等實物) 或 邏輯對象(如 運動, 健康等); 對象是將狀態(數據) 和行為(功能) 組合在一起的軟件模塊. 類是描寫敘述一組相似對象共同…

kkt條件的matlab仿真,請教關于SVM中KKT條件的推導

KKT條件第一項是說最優點必須滿足所有等式及不等式限制條件&#xff0c;也就是說最優點必須是一個可行解&#xff0c;這一點自然是毋庸置疑的。第二項表明在最優點 x*&#xff0c; ?f 必須是 ?hj 和 ?gk 的線性組合&#xff0c;和都叫作拉格朗日乘子。所不同的是不等式限制條…

公共wifi做家用_如何在公共網絡上獲得免費的wifi

公共wifi做家用by Kyle McDonald凱爾麥克唐納(Kyle McDonald) 如何在公共網絡上獲得免費的wifi (How to get free wifi on public networks) This short tutorial describes a few methods for gaining access to the internet, a basic human right, from public wireless ne…

python學習之旅

一、入門 1.Python 面向對象編程 2.jquery入門 3.HTMLCSS基礎入門 4.Javascript初步 5.Python語言編程基礎 二、初級階段 1.Git 與 GitHub 2.Python 爬蟲基礎 3.django進階 4.django項目部署 5.ajax入門 6.django基礎 7.Mysql基礎 三、中級階段 1.Linux基礎 2.Python :socket a…

c/c++ 重載運算符 函數調用運算符

重載運算符 函數調用運算符 把一個類的對象a&#xff0c;當成函數來使用&#xff0c;比如a()&#xff0c;所以需要重載operator()方法。重載了函數調用運算符的類的對象&#xff0c;就是函數對象了。 還有什么是函數對象呢&#xff1f;&#xff1f;&#xff1f; lambda是函數對…

matlab 萬能,matlab 萬能實用的線性曲線擬合方法

在科學計算和工程應用中&#xff0c;經常會遇到需要擬合一系列的離散數據&#xff0c;最近找了很多相關的文章方法&#xff0c;在這里進行總結一下其中最完整、幾乎能解決所有離散參數線性擬合的方法第一步&#xff1a;得到散點數據根據你的實際問題得到一系列的散點例如&#…

socket websocket

1.websocket客戶端 websocket允許通過JavaScript建立與遠程服務器的連接&#xff0c;從而實現客戶端與服務器間雙向的通信。在websocket中有兩個方法&#xff1a;      1、send() 向遠程服務器發送數據    2、close() 關閉該websocket鏈接  websocket同時還定義了幾…

javascript原型_JavaScript的原型:古怪,但這是它的工作原理

javascript原型by Pranav Jindal通過普拉納夫金達爾 JavaScript的原型&#xff1a;古怪&#xff0c;但這是它的工作原理 (Prototype in JavaScript: it’s quirky, but here’s how it works) The following four lines are enough to confuse most JavaScript developers:以下…

mysql函數之SUBSTRING_INDEX(str,/,-1)

SUBSTRING_INDEX的用法&#xff1a; ?SUBSTRING_INDEX(str,delim,count) 在定界符 delim 以及count 出現前&#xff0c;從字符串str返回自字符串。若count為正值,則返回最終定界符(從左邊開始) 若為-1則是從后往前截取 SELECT substring_index(Hn_P00001, P, -1) -- 結果是…

mysql8.0主從配置,MySQL 8.0主從服務器(Master-Slave)配置

一、介紹MySQL 主從復制的方式有多種&#xff0c;本文主要演示基于基于日志(binlog)的主從復制方式。MySQL 主從復制(也稱 A/B 復制) 的原理&#xff1a;Master將數據改變記錄到二進制日志(binary log)中&#xff0c;也就是配置文件log-bin指定的文件&#xff0c; 這些記錄叫做…

第十二章 Shell腳本編寫及常見面試題(三)

本章目錄&#xff1a;12.21 FTP下載文件#!/bin/bash if [ $# -ne 1 ]; thenecho "Usage: $0 filename" fi dir$(dirname $1) file$(basename $1) ftp -n -v << EOF # -n 自動登錄 open 192.168.1.10 user admin adminpass binary # 設置ftp傳輸模式為二進制…

亞馬遜面試有幾輪_經過幾個月的Google面試準備,我被亞馬遜錄用

亞馬遜面試有幾輪by Googley as Heck由Googley飾演Heck 經過幾個月的Google面試準備&#xff0c;我被亞馬遜錄用 (After months of preparing for the Google interview, I got hired by Amazon) As you may know, the last 11 months have been very difficult for me. As a …