当前位置:网站首页>第2章-矩阵及其运算-矩阵创建(1)
第2章-矩阵及其运算-矩阵创建(1)
2022-08-10 10:32:00 【伊伊_f】
from sympy.matrices import *
1. 2x2矩阵
Matrix([[1,0], [0,1]])
2.Matrix套嵌
Matrix((
Matrix((
(1,0,0),
(0,1,0)
)),
(0,0,-1)
))
3. 行向量(行矩阵)
Matrix([[1, 2, 3]])
4. 列向量(列矩阵)
Matrix([1, 2, 3])
5.指定行列数
创建2x3矩阵
Matrix(2, 3, [1, 2, 3, 4, 5, 6])
6. 定义函数
def f(i,j):
if i==j:
return 1
else:
return 0
Matrix(4,4,f) 
7.使用lambda
Matrix(3, 4, lambda i,j: 1 - (i+j) % 2)
8.单位矩阵
(1)eye(3)
(2)eye(2,3)
9.全零矩阵
(1)zeros(3)
(2)zeros(2,3)
10. 全1矩阵
(1)ones(3)
(2)ones(2,3)
11.对角线矩阵
diag(1,2,3,4)
12.变量矩阵
from sympy.matrices import *
from sympy import symbols
a1,a2,a3,a4=symbols('a1 a2 a3 a4')
b1,b2,b3,b4=symbols('b1 b2 b3 b4')
A=Matrix(2,2,['a1','a2','a3','a4'])
B=Matrix(2,2,['b1','b2','b3','b4'])
C=A*B
C
13.矩阵与线性变换(矩阵系数与方程组互转)
边栏推荐
- 干货!ASSANet:让PointNet++更快更强
- GPU accelerated Pinterest recommendation model, the number of parameters increased by 100 times, and the user activity increased by 16%
- 14 high-frequency handwritten JS interview questions and answers to consolidate your JS foundation
- Thrift -- 跨语言RPC 框架
- 面试官:项目中 Dao、Service、Controller、Util、Model 怎么划分的?
- 突破次元壁垒,让身边的玩偶手办在屏幕上动起来!
- "Data Strategy" Results-Driven Enterprise Data Strategy: Organization and Governance
- 「时序数据库」使用cassandra进行时间序列数据扫描
- ZZULIOJ 1124: 两个有序数组合并
- WebView2 通过 PuppeteerSharp 实现爬取 王者 壁纸 (案例版)
猜你喜欢

8月份DB-Engines 数据库排行榜最新战况

网络安全笔记6——数字证书与公钥基础设施

Redis (three) - detailed configuration file, publish and subscribe, new data types

FastReport.Net 2022.2.17 Crack

Taro小程序跨端开发入门实战

bus event bus use

Techches Transformer the join wisdom source the author cao, visual basic model study

OneFlow source code parsing: operator instructions executed in a virtual machine

「首席工程师」首席(Principal )工程师修炼之道

STM32 encapsulation ESP8266 a key configuration function: implementations of AP mode and the STA mode switch, server and the client to create
随机推荐
MySQL 执行查询流程
是什么影响了MySQL性能?
FastReport.Net 2022.2.17 Crack
leetcode:334. 递增的三元子序列
谷歌数据中心发生“电力事故”造成 3 人受伤
Summary of whitespace, space and escape characters in C language
越折腾越好用的 3 款开源 APP
[C language] Header file #include
, conio is Console Input/Output (console input and output) 杭电多校七 1008-Triangle Game(博弈)
owl.carousel poster card Slider carousel switch
bus event bus use
js对象转FormData对象(一般用于上传)
TCP/IP笔记
MongoDB数据库笔记
ZZULIOJ 1124: Merge two sorted arrays
ZZULIOJ 1116 删除元素【删】
STM32封装ESP8266一键配置函数:实现实现AP模式和STA模式切换、服务器与客户端创建
Several small projects that I have open sourced over the years
ZZULIOJ 1124: 两个有序数组合并
Research on motion capture system for indoor combined positioning technology