当前位置:网站首页>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 .
边栏推荐
- Design of FIR digital filter
- 3.2 multiple condition judgment
- 分布式Session解决方案
- Typescript learning materials
- 带你认识图数据库性能和场景测试利器LDBC SNB
- Create a database and use
- SQL injection principle
- 2022-2-16 learning the imitated Niuke project - Section 6 adding comments
- 【Pygame小遊戲】這款“吃掉一切”遊戲簡直奇葩了?通通都吃掉嘛?(附源碼免費領)
- 设计原则和思想:设计原则
猜你喜欢

2022年最新《谷粒学院开发教程》:8 - 前台登录功能

Introduce you to ldbc SNB, a powerful tool for database performance and scenario testing

PSS:你距离NMS-free+提点只有两个卷积层 | 2021论文

Jialichuang EDA professional edition all offline client release

Why can't the start method be called repeatedly? But the run method can?

面试半年,上个月成功拿到阿里P7offer,全靠我啃烂了这份2020最新面试题!
![[high concurrency] deeply analyze the callable interface](/img/24/33c3011752c8f04937ad68d85d4ece.jpg)
[high concurrency] deeply analyze the callable interface

PSS: vous n'êtes qu'à deux niveaux du NMS Free + Lifting point | 2021 Paper

LeetCode每日一练(无重复字符的最长子串)

SIGKDD22|图“预训练、提示、微调”范式下的图神经网络泛化框架
随机推荐
SQL parsing practice of Pisa proxy
3.2 multiple condition judgment
可变参数模板 Variadic Templates
PSS: vous n'êtes qu'à deux niveaux du NMS Free + Lifting point | 2021 Paper
洛谷入门2【分支结构】题单题解
About tensorflow using GPU acceleration
What should the ultimate LAN transmission experience be like
[pygame Games] ce jeu "eat Everything" est fantastique? Tu manges tout? (avec code source gratuit)
如果想用dms来处理数据库权限问题,想问下账号只能用阿里云的ram账号吗(阿里云的rds)
What is the open source compatibility of the current version of polardb-x? mysql8?
3.1 simple condition judgment
28 object method extension
A distribution fission activity is more than just a circle of friends!
漏洞复现----34、yapi 远程命令执行漏洞
Luogu_ P1007 single log bridge_ thinking
[170] the PostgreSQL 10 field type is changed from string to integer, and the error column cannot be cast automatically to type integer is reported
E ModuleNotFoundError: No module named ‘psycopg2‘(已解决)
我想买固收+产品,但是不了解它主要投资哪些方面,有人知道吗?
请问阿里云实验中 k8s 对于3306端口转发,同时开启mysql客户端就会异常终止,是什么原因呢?
Pisa-Proxy 之 SQL 解析实践