当前位置:网站首页>Julia constructs diagonal matrix
Julia constructs diagonal matrix
2022-06-27 15:55:00 【Analysis of breeding data】
Be careful ,julia There is no diag function , If you want to define 4*4 Diagonal matrix of , You can use the following methods :
1. Use Matrix function
using LinearAlgebra
Matrix{Float64}(I,4,4)
- 1.
- 2.
Be careful ,Matrix{Float64}(I,4,4) There are letters in the middle I, Not Numbers 1
julia> using LinearAlgebra
julia> Matrix{Float64}(I,4,4)
4×4 Array{Float64,2}:
1.0 0.0 0.0 0.0
0.0 1.0 0.0 0.0
0.0 0.0 1.0 0.0
0.0 0.0 0.0 1.0
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
2. establish zeros matrix
b2 = zeros(4,4)
b2
- 1.
- 2.
adopt for The diagonal of the loop is 1

Get it done .
边栏推荐
- FPGA based analog I ² C protocol system design (with main code)
- 洛谷入门1【顺序结构】题单题解
- Create a database and use
- 是不是只要支持JDBC / ODBC协议的客户端恐惧,PolarDB-X可通过相关工具的客户端访问?
- Introduction to TTCAN brick moving
- Can the teacher tell me what the fixed income + products are mainly invested in?
- Difference between special invoice and ordinary invoice
- Design of vga/lcd display controller based on FPGA (with code)
- On traversal of tree nodes
- Go error collection | when a function uses a return value with a parameter name
猜你喜欢

SIGKDD22|图“预训练、提示、微调”范式下的图神经网络泛化框架
![洛谷_P1008 [NOIP1998 普及组] 三连击_枚举](/img/9f/64b0b83211bd1c615f2db9273bb905.png)
洛谷_P1008 [NOIP1998 普及组] 三连击_枚举

Numerical extension of 27es6

洛谷入门1【顺序结构】题单题解

【Pygame小游戏】这款“吃掉一切”游戏简直奇葩了?通通都吃掉嘛?(附源码免费领)

Derivation of Halcon camera calibration principle

3.1 simple condition judgment

守护雪山之王:这些AI研究者找到了技术的新「用武之地」

2022-2-16 learning the imitated Niuke project - Section 6 adding comments

SQL injection principle
随机推荐
NFT dual currency pledge liquidity mining DAPP contract customization
Cesium 使用MediaStreamRecorder 或者MediaRecorder录屏并下载视频,以及开启摄像头录像。【转】
PolarDB-X现在版本的开源兼容什么?mysql8?
16 -- 删除无效的括号
【Pygame小遊戲】這款“吃掉一切”遊戲簡直奇葩了?通通都吃掉嘛?(附源碼免費領)
MySQL中符号@的作用
Knightctf 2022 web section
Gin general logging Middleware
FPGA based analog I ² C protocol system design (with main code)
Introduction to TTCAN brick moving
SIGKDD22|图“预训练、提示、微调”范式下的图神经网络泛化框架
Typescript learning materials
Google tool splits by specified length
利用Redis实现订单30分钟自动取消
E modulenotfounderror: no module named 'psychopg2' (resolved)
Openssf security plan: SBOM will drive software supply chain security
3.2 multiple condition judgment
带你认识图数据库性能和场景测试利器LDBC SNB
CNN convolutional neural network (the easiest to understand version in History)
Go error collection | when a function uses a return value with a parameter name