是一个给自己期中复习做的笔记。
第二课
关于矩阵
mxn的矩阵,是m行n列;
先行后列,如A2,1 就是3;
单位矩阵:
关于向量
向量:有序有限的一列数字;
定义:
了解列向量,横向量,零向量。
向量可以是一组解。
关于单位向量
只有一个1,其他都是0;哪里是1,下标就是几。
向量的四则运算
加:
标量乘以向量:
第三课
高斯消元计算器
计算器网址
Euclidean Plane(欧几里得平面)
定义:
运算:
关于norm范数:
范数的性质:
类比高中学的向量。
第四课
用matlab寻找二元一次方程解
x=linspace(-1,7,100);//从-1到7开辟100个横向量
//that will produce a vector x with 100 entries with the first entry equal to –1, the last entry equal equal to 7, and the remaining 98 entries equally space between –1 and 7.
y=7-x;//把要求的函数之一写上去;
plot(x,y);//画出x,y的图
xlabel('x');
ylabel('y');//给出横纵坐标
hold on;//再画下一条线;
y=(1+x)/3;
plot(x,y);//画线
axis('equal');//让轴相同;
grid;//给格子;
其中,x=linspace(a,b,c)是给x的范围,从a到b中有c个;
plot(x,y)是画图(画上面给出的函数图);
xlabel(‘x’)和ylabel(‘y’)是在第一个plot后,给出坐标系;
hold on用在还有函数要画前;
当函数已经plot完,就用:
axis(‘equal’);
grid;
使横纵坐标相同,并给格子;
Row Operations(行运算)
Gaussian elimination uses elementary row operations to set the entries that are in the lower left of A to zero.
Linear Equations with Special Coefficients
根号2用sqrt(2);
2Π用2*pi;
e用exp(1);
Systems with Integers and Rational Numbers
ans=矩阵A\列向量b;
第五课
3D Visualization in MATLAB
[x,y]=meshgrid(-5:0.5:5);//The first command tells MATLAB to create a square grid in the xy-plane. Grid points are equally spaced between –5 and 5 at intervals of 0.5 on both x and y axes.
z=2*x-3*y+2;//一个函数
surf(x,y,z)//tells MATLAB to graph the surface containing the points (x, y, z).
hold on;
z = -2*x + 3*y;
surf(x, y, z)
hold on;
z = 3*x - 0.2*y + 1;
surf(x, y, z)
[x,y]=meshgrid(-5:0.5:5);给出xy坐标系,从-5到5,每0.5等距;
函数的左边要是同一个字母;
surf(x,y,z)是画出这个平面,不加;分号才有图出来;
画完一个图后若还有图要画,hold on;
这样三个平面就画出来了:
若想求三个平面的交点:
这样三维的交点就求出来了。
Position Vector in 3D
第六课
Defining Vectors in Matlab
定义一个row vector,如:
若不想输出v,则加分号;
空格分隔;
定义一个column vector:
加一个单引号’
定义一连串数字:如1~8:
step不是1的:
.25即0.25;
Accessing Elements within Vector
访问向量里的元素:
如:
v=[0:2:8];
v'
v(1:3)
v(1:2:4)
第一步创建了变量v,是0 2 4 6 8,从0~8中间隔2出一个;
第二步输出0 2 4 6 8的列向量;
第三步访问v,从第一个开始到第三个,即0 2 4;
第四步从1开始,到第4个,每2个输出,即0 4;
Basic Operations on Vectors
Defining Matrices in MATLAB
关于访问,第一行到第二行,第二列到第三列:
Inverse Matrix
A*inv(A)=单位矩阵;
Matrices in MATLAB(有很多运算!)
transport是row变column;
inverse是:A*inv(A)=eye(n);
*是矩阵相乘;
.*是点乘,元素间一个个地乘;
eye(2)是2x2的单位矩阵;
第七课
Invertibility
右上角和左下角互换,左上角和右下角互换后取相反数;
一些性质:
Computing Inverse Matrices
第八课
Matrix Revision
Multiplication:
Matrix times Matrix (Dot Product):
Multiplication: Outer Product:
Multiplication: Inner Product:
Inverse Matrix Corollary
ad交换,bc变负;
Triangular Matrices
Determinant
Solving Simultaneous Equations:
考试会考的:
3x3的行列式: