Matlab symbolic computation memo

Define a symbol

expr = sym(‘(x=y)^2‘)

Define symbols

syms a b c d             % four symbols defined
A = [a b ; c d ]         % A is also a symbol
det(A)                   % symbolic computation of determinant

Factor and expand

factor(sym(‘x^2 - y^2‘))
expand(sym(‘(x-y)^2‘)

Limits

limit(f, x, a)
limit(f, x, a, ‘left‘)
limit(f, x, a, ‘right‘)

Differentiation

diff(f, x, n)       % default value of n is 1

Integration

int(f, x)            % indefinite integral
int(f, x, a, b)     % integral over interval [a, b]

Fourier transform

fourier(fx, x, t)
ifourier(fw, t, x)

Laplace transform

laplace(fx, x, t)
ilaplace(fw, t, x)

Composition of functions

>> sym x;
>> f1 = sin(x);
>> f2 = cos(x);
>> compose(f1, f2)

ans =

sin(cos(x))

Solving differential equations

>> dsolve(‘D2y + omega^2 * y == 0‘,‘x‘)

ans =

C4*exp(omega*x*i) + C5*exp(-omega*x*i)

>> dsolve(‘Dy + y == 0‘, ‘y(0) == 3‘, ‘x‘) % ‘x‘ as independent variable ans = 3*exp(-x)

Contour plotting

>> syms x y;
>> f = exp(-x^2 + -y^2);
>> ezcontour(f, [-1 1 -1 1])

>> ezcontourf(f, [-1 1 -1 1])

Mesh plotting

ezmesh(f, [-1 1 -1 1])

>> ezmesh(@(x,y)(1+0.2*cos(y)).*cos(x), @(x,y)(1+0.2*cos(y)).*sin(x), @(x,y)0.2*sin(y), [0, 2*pi, 0, 2*pi])

ezplot(f, ...)

ezplot3(x, y, z, [tmin tmax])ezplot3(..., ‘animate‘)

ezpolar(f)ezpolar(f, [theta_min theta_max])

ezsuf(f)ezsurf(f, domain)ezsurf(x, y, z, [smin smax tmin tmax])
时间: 2024-12-25 03:49:28

Matlab symbolic computation memo的相关文章

Common Lisp编程初步---环境搭建和外部lisp代码运行

1 介绍 Lisp是世界上第二古老的语言,第一古老语言是Fortran.Lisp语言的创立者为John McCarthy,一位人工智能领域里的先驱.该语言自创立以来经历了50多年而不衰,是一种很有生命力的语言.该语言的发展和使用与CMU和MIT两所高校密不可分,在相当长的时期内是这两所高校的大学计算机课程指定语言. 在该语言创立之初,除了创建者外,还有其他的一些高校著名学者也参与到了Lisp语言的发展完善当中.于是就出现了多个Lisp的dialect,这对该语言的移植非常不便.为此在1981年丛

Github 的一个免费编程书籍列表

Index Ada Agda Alef Android APL Arduino ASP.NET MVC Assembly Language Non-X86 AutoHotkey Autotools Awk Bash Basic BETA C C# C++ Chapel Cilk Clojure COBOL CoffeeScript ColdFusion Cool Coq D Dart DB2 Delphi / Pascal DTrace Elasticsearch Emacs Erlang F#

计算机类免费电子书共享

列表最早来自stackoverflow上的一个问题:List of freely available programming books 现在在github上进行维护:free-programming-books List of Free Programming Books This list initially was a clone of stackoverflow - List of freely available programming books by George Stocker.

python 爬虫学习笔记1

经过一段时间的学习,终于入了门 先爬一个csdn 的blog练练手 整体思路是首先判断某个blog有多少页 然后根据页数 去获得相应的url 再爬出每一页的title和对应的url 这里使用了BeautifulSoup来解析页面 #coding=utf-8 import urllib2 from bs4 import BeautifulSoup import sys reload(sys) sys.setdefaultencoding('utf-8') def query_item(input,

Github上的1000多本免费电子书重磅来袭!

这个GIthub库的免费电子书资源绝对值得你拥有,赶紧收藏吧! 以前 StackOverFlow 也给出了一个免费电子书列表,现在在Github上可以看到时刻保持更新的列表了. 瞥一眼下面的书籍分类目录,你就能知道这个免费电子书库的含金量了吧.记得一定要看几本,千万别下载了大量书籍而束之高阁! 行动重于空想! Github地址:     https://github.com/vhf/free-programming-books/blob/master/free-programming-books

计算机科学中最重要的32个算法

奥地利符号计算研究所(Research Institute for Symbolic Computation,简称RISC)的Christoph Koutschan博士在自己的页面上发布了一篇文章,提到他做了一个调查,参与者大多数是计算机科学家,他请这些科学家投票选出最重要的算法,以下是这次调查的结果,按照英文名称字母顺序排序. A* 搜索算法——图形搜索算法,从给定起点到给定终点计算出路径.其中使用了一种启发式的估算,为每个节点估算通过该节点的最佳路径,并以之为各个地点排定次序.算法以得到的次

Common Lisp学习资源整理

Lisp Hackers: Interviews with 100x More Productive Programmers Posted on June 26th, 2013 Lisp Hackers: Interviews with 100x More Productive Programmers, by Vsevolod Dyomkin, is available for free in multiple formats from Leanpub. Let Over Lambda Post

【转载】发个有用的:国际学术期刊会议大排名

Rank Conference Full Name1 OSDI Operating Systems Design and Implementation2 SOSP Symposium on Operating Systems Principles3 SIGCOMM Special Interest Group on Data Communication4 MOBICOM Mobile Computing and Networking5 SIGGRAPH Annual Conference on

中国计算机学会CCF推荐国际学术会议期刊

中国计算机学会推荐国际学术期刊 (计算机系统与高性能计算) 一.A类 序号 刊物简称 刊物全称 出版社 网址 1 TOCS ACM Transactions on Computer Systems ACM http://tocs.acm.org/ 2 TOC IEEE Transactions on Computers IEEE http://www.computer.org/portal/web/tc 3 TPDS IEEE Transactions on Parallel and Distr