# Simple system with solution 1,2,3
A <- matrix(c(3,1,2,-1,-4,2,1,1,7),ncol=3)
b <- c(4,-4,27)
# Solution
x <- PJacobi(A,b)
print(x)
# Start from a different point
x0 <- c(-1,2,8)
x <- PJacobi(A,b,x0)
print(x)
Run the code above in your browser using DataLab