当前位置:网站首页>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 .
边栏推荐
- About tensorflow using GPU acceleration
- 分布式Session解决方案
- 正则匹配以什么开头、以什么结尾,以非什么开头,以非什么结尾
- The role of the symbol @ in MySQL
- Typescript learning materials
- logstash排除特定文件或文件夹不采集上报日志数据
- The latest development course of grain college in 2022: 8 - foreground login function
- Expert: those who let you go to a good school with a low score are all Scams
- [pygame Games] ce jeu "eat Everything" est fantastique? Tu manges tout? (avec code source gratuit)
- 3.1 simple condition judgment
猜你喜欢
Numerical extension of 27es6
SQL parsing practice of Pisa proxy
开源二三事|ShardingSphere 与 Database Mesh 之间不得不说的那些事
Introduce you to ldbc SNB, a powerful tool for database performance and scenario testing
3.2 multiple condition judgment
Introduce you to ldbc SNB, a powerful tool for database performance and scenario testing
保留有效位数;保留小数点后n位;
R language error
Leetcode daily practice (longest substring without repeated characters)
E modulenotfounderror: no module named 'psychopg2' (resolved)
随机推荐
Luogu_ P1008 [noip1998 popularization group] triple strike_ enumeration
Eolink launched a support program for small and medium-sized enterprises and start-ups to empower enterprises!
What should the ultimate LAN transmission experience be like
Google Earth Engine(GEE)——Export. image. The difference and mixing of toasset/todrive, correctly export classification sample data to asset assets and references
16 -- remove invalid parentheses
Pisa-Proxy 之 SQL 解析实践
Openssf security plan: SBOM will drive software supply chain security
Does polardb-x open source support mysql5.7?
ICML 2022 | 阿⾥达摩院最新FEDformer,⻓程时序预测全⾯超越SOTA
2022-2-15 learning the imitated Niuke project - Section 5 shows comments
是不是只要支持JDBC / ODBC协议的客户端恐惧,PolarDB-X可通过相关工具的客户端访问?
LeetCode每日一练(主要元素)
Use redis to automatically cancel orders within 30 minutes
Beginner level Luogu 2 [branch structure] problem list solution
我想買固收+產品,但是不了解它主要投資哪些方面,有人知道嗎?
What is the open source compatibility of the current version of polardb-x? mysql8?
What are the characteristics of fixed income + products?
SQL parsing practice of Pisa proxy
PolarDB-X开源版有没有支持 mysql5.7 的版本?
#28对象方法扩展