A guide to Matlab for Beginners and Experienced Users——学习笔记【2】
2009-01-01 18:13
573 查看
矩阵求解
解线性方程组Ax=b可以使用x=A/b计算A的特征值和特征向量>> A=[1,2,3;4,5,6;2,3,4]A = 1 2 3 4 5 6 2 3 4>> eig(A)ans = 10.29150262212917 -0.29150262212918 -0.00000000000000>> [U,R]=eig(A)U = -0.33170876792682 -0.66019272369215 0.40824829046386 -0.80621845037388 0.72434202704777 -0.81649658092773 -0.48987866207584 -0.19868114011218 0.40824829046386R = 10.29150262212917 0 0 0 -0.29150262212918 0 0 0 -0.00000000000000U是特征向量,R是特征值。
微分
>> syms 'x';diff(x^3)ans =3*x^2>> f=inline('x^3-x','x');diff(f(x))ans =3*x^2-1>> diff(f(x),2) ans = 6*x >> diff(f(x),3) ans = 6 >> diff(f(x),4) ans = 0
解微分方程
求解y'=x>> dsolve('Dy=x','x') ans = 1/2*x^2+C1求解xy'+1=y >> dsolve('x*Dy+1=y','x') ans = 1+x*C1
积分
不定积分>> int('x^(-2)','x')ans = -1/x
定积分>> int(x^2,1,10)ans = 333 >> int(asin(x),0,1)ans = 1/2*pi-1
数值积分>> quadl(vectorize(x^2), 0, 1)ans = 0.3333
多重积分>> int(int(x^2+y^2,y,0,sin(x)),0,pi)ans =pi^2-32/9
极限
>> syms x;limit(sin(x)/x,x,0)ans =1>> limit(x,x,3)ans =3
左右极限>> syms x;limit(abs(x)/x,x,0,'left')ans =-1>> syms x;limit(abs(x)/x,x,0,'right')ans =1
趋于无穷时的极限将上述的0换成Inf或者-Inf
求和和求积
>> x=1:10x = 1 2 3 4 5 6 7 8 9 10>> sum(x)ans = 55>> prod(x)ans = 3628800
符号求和>> syms k n;symsum(1/k-1/(k+1),1,n)ans = -1/(n+1)+1 >> syms k n;symsum(1/k-1/(k+1),1,Inf)ans = 1
泰勒展开(不太明白,以后查查资料)
>> syms x;taylor(exp(x),x,10)
解线性方程组Ax=b可以使用x=A/b计算A的特征值和特征向量>> A=[1,2,3;4,5,6;2,3,4]A = 1 2 3 4 5 6 2 3 4>> eig(A)ans = 10.29150262212917 -0.29150262212918 -0.00000000000000>> [U,R]=eig(A)U = -0.33170876792682 -0.66019272369215 0.40824829046386 -0.80621845037388 0.72434202704777 -0.81649658092773 -0.48987866207584 -0.19868114011218 0.40824829046386R = 10.29150262212917 0 0 0 -0.29150262212918 0 0 0 -0.00000000000000U是特征向量,R是特征值。
微分
>> syms 'x';diff(x^3)ans =3*x^2>> f=inline('x^3-x','x');diff(f(x))ans =3*x^2-1>> diff(f(x),2) ans = 6*x >> diff(f(x),3) ans = 6 >> diff(f(x),4) ans = 0
解微分方程
求解y'=x>> dsolve('Dy=x','x') ans = 1/2*x^2+C1求解xy'+1=y >> dsolve('x*Dy+1=y','x') ans = 1+x*C1
积分
不定积分>> int('x^(-2)','x')ans = -1/x
定积分>> int(x^2,1,10)ans = 333 >> int(asin(x),0,1)ans = 1/2*pi-1
数值积分>> quadl(vectorize(x^2), 0, 1)ans = 0.3333
多重积分>> int(int(x^2+y^2,y,0,sin(x)),0,pi)ans =pi^2-32/9
极限
>> syms x;limit(sin(x)/x,x,0)ans =1>> limit(x,x,3)ans =3
左右极限>> syms x;limit(abs(x)/x,x,0,'left')ans =-1>> syms x;limit(abs(x)/x,x,0,'right')ans =1
趋于无穷时的极限将上述的0换成Inf或者-Inf
求和和求积
>> x=1:10x = 1 2 3 4 5 6 7 8 9 10>> sum(x)ans = 55>> prod(x)ans = 3628800
符号求和>> syms k n;symsum(1/k-1/(k+1),1,n)ans = -1/(n+1)+1 >> syms k n;symsum(1/k-1/(k+1),1,Inf)ans = 1
泰勒展开(不太明白,以后查查资料)
>> syms x;taylor(exp(x),x,10)
相关文章推荐
- A guide to Matlab for Beginners and Experienced Users——学习笔记【1】
- Swift学习笔记 Introduction to Swift Programming for beginners
- The Focal easy guide to Maya 5: for new users and professionals
- NumPy学习笔记 (附录: NumPy for Matlab Users)
- The Definitive Guide To Django 2 学习笔记(一) Views and UrL confsRL
- A guide to convolution arithmetic for deep learning学习笔记
- VBA学习笔记(4)-Section, Row, and Cell Indices for Shapes
- How to read and understand a scientific paper: a guide for non-scientists
- R-CNN学习笔记2:Rich feature hierarchies for accurate object detection and semantic segmentation
- Techno Security's Guide to Managing Risks for IT Managers, Auditors and Investigators
- 九十分钟极速入门Linux——Linux Guide for Developments 学习笔记
- [分布式系统学习]阅读笔记 Distributed systems for fun and profit 之一 基本概念
- How to Read and Understand a Scientific Paper: A Step-by-Step Guide for Non-Scientists
- The Definitive Guide To Django 2 学习笔记(五) 第四章 模板 (一)基本模板系统
- The Definitive Guide To Django 2 学习笔记(六) 第四章 模板 (二)使用模板系统
- cilk之User Guide学习笔记(4)cilk_for的分析
- 深度学习论文笔记--FaceNet: A Unified Embedding for Face Recognition and Clustering
- 学习MNIST For ML Beginners笔记
- View Programming Guide for iOS 学习笔记_1
- OSWorkflow: A guide for Java developers and architects to integrating, open-source Business Process Management (Paperback)