2 ms·
R: m = matrix( c(0,0,1,1,0,0,0,1,0), nrow=3 ) v = c(2,3,1) solve(m,v) [1] 1 2 3 Julia: for this code snippet the syntax is identical to Matla
by em500 10y ago
R:
m = matrix( c(0,0,1,1,0,0,0,1,0), nrow=3 )
v = c(2,3,1)
solve(m,v)
[1] 1 2 3
Julia: for this code snippet the syntax is identical to Matlab:
m = [0 1 0; 0 0 1; 1 0 0]
v = [2 3 1]'
m\v
3×1 Array{Float64,2}:
1.0
2.0
3.0