当前位置:网站首页>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 .
边栏推荐
- Principle Comparison and analysis of mechanical hard disk and SSD solid state disk
- What are the characteristics of fixed income + products?
- [pygame Games] ce jeu "eat Everything" est fantastique? Tu manges tout? (avec code source gratuit)
- PolarDB-X开源版有没有支持 mysql5.7 的版本?
- [issue 17] golang's one-year experience in developing Meitu
- 老师能给我说一下固收+产品主要投资于哪些方面?
- Admixture usage document Cookbook
- Centos8 PostgreSQL initialization error: initdb: error: invalid locale settings; check LANG and LC_* environment
- E modulenotfounderror: no module named 'psychopg2' (resolved)
- SQL parsing practice of Pisa proxy
猜你喜欢

3.4 fixed number of cycles II

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

保留有效位数;保留小数点后n位;
The role of the symbol @ in MySQL

漏洞复现----34、yapi 远程命令执行漏洞

开源二三事|ShardingSphere 与 Database Mesh 之间不得不说的那些事

QT notes (XXVIII) using qwebengineview to display web pages

Eolink launched a support program for small and medium-sized enterprises and start-ups to empower enterprises!

Numerical extension of 27es6

2022-2-16 learning the imitated Niuke project - Section 6 adding comments
随机推荐
SQL parsing practice of Pisa proxy
[issue 17] golang's one-year experience in developing Meitu
Eolink launched a support program for small and medium-sized enterprises and start-ups to empower enterprises!
Problems encountered in vs compilation
ORM表关系及操作
I want to buy fixed income + products, but I don't know what its main investment is. Does anyone know?
目前PolarDB-X是不支持数据库自制服务DAS么?
Go error collection | when a function uses a return value with a parameter name
[pygame Games] ce jeu "eat Everything" est fantastique? Tu manges tout? (avec code source gratuit)
Condom giants' sales have fallen by 40% in the past two years. What are the reasons for the decline?
Leetcode daily practice (longest substring without repeated characters)
What is the open source compatibility of the current version of polardb-x? mysql8?
一场分销裂变活动,不止是发发朋友圈这么简单!
Admixture usage document Cookbook
跨域图像的衡量新方式Style relevance:论文解读和代码实战
LeetCode每日一练(无重复字符的最长子串)
E ModuleNotFoundError: No module named ‘psycopg2‘(已解决)
NFT dual currency pledge liquidity mining DAPP contract customization
Luogu_ P1003 [noip2011 improvement group] carpet laying_ Violence enumeration
On traversal of tree nodes