当前位置:网站首页>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 .
边栏推荐
- CNN convolutional neural network (the easiest to understand version in History)
- R language error
- Leetcode daily practice (longest substring without repeated characters)
- 洛谷入门1【顺序结构】题单题解
- 事务的四大特性
- CentOS8-postgresql初始化时报错:initdb: error: invalid locale settings; check LANG and LC_* environment
- 一场分销裂变活动,不止是发发朋友圈这么简单!
- Beginner level Luogu 2 [branch structure] problem list solution
- #27ES6的数值扩展
- 避孕套巨头过去两年销量下降40% ,下降原因是什么?
猜你喜欢

Slow bear market, bit Store provides stable stacking products to help you cross the bull and bear

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

带你认识图数据库性能和场景测试利器LDBC SNB

PSS:你距離NMS-free+提點只有兩個卷積層 | 2021論文

E ModuleNotFoundError: No module named ‘psycopg2‘(已解决)

【kotlin】第二天

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

Li Chuang EDA learning notes 16: array copy and array distribution

Vulnerability recurrence ----- 34. Yapi remote command execution vulnerability

A distribution fission activity is more than just a circle of friends!
随机推荐
CNN convolutional neural network (the easiest to understand version in History)
Today, Teng Xu came out with 37k during the interview. It's really a miracle. He showed me his skill
Open source 23 things shardingsphere and database mesh have to say
我想買固收+產品,但是不了解它主要投資哪些方面,有人知道嗎?
请问阿里云实验中 k8s 对于3306端口转发,同时开启mysql客户端就会异常终止,是什么原因呢?
固收+产品有什么特点?
Design of digital video signal processor based on FPGA (with main code)
专用发票和普通发票的区别
What should the ultimate LAN transmission experience be like
A distribution fission activity is more than just a circle of friends!
[interview questions] common interview questions (I)
SIGKDD22|图“预训练、提示、微调”范式下的图神经网络泛化框架
Gin general logging Middleware
如果想用dms来处理数据库权限问题,想问下账号只能用阿里云的ram账号吗(阿里云的rds)
Design of CAN bus controller based on FPGA (with main codes)
E modulenotfounderror: no module named 'psychopg2' (resolved)
What are the characteristics of fixed income + products?
Cesium 使用MediaStreamRecorder 或者MediaRecorder录屏并下载视频,以及开启摄像头录像。【转】
VS编译遇到的问题
LeetCode每日一练(无重复字符的最长子串)