Jacobi method in matlab

11 ビュー (過去 30 日間)
steve Brian
steve Brian 2020 年 4 月 9 日
編集済み: steve Brian 2020 年 4 月 9 日
Hi there, I'm at the beginning and I don't know how to work with matrices.
I have a function that receives as a parameter, a matrix in the form of CSR, an iteration vector and a tolerance
My function is of form: function [x] = jacobi_sparse (values, colomn, rowptr, c, tol) %1
I create a function which multiplies a matrix A in the form csr (A) with a vector(x), like this: (y = Ax)
function [y] = csr_multiplication(values, colind, rowptr, x) %2
n = length(x);
y = zeros(n, 1);
for i = 1:n
for j = rowptr(i):rowptr(i+1) - 1
y(i) = y(i) + values(j) * x(colind(j));
The function I want to implement %1, i want to use my %2 to return value of x.
tol - is the tolerance under which iterations stop.
The initial vector with which the solution is approximated is 0
It is something like the Jacobian method, and function %1 need to return x, base on function %2.
Please help me, thanks a lot!

回答 (0 件)


Help Center および File ExchangeSpline Postprocessing についてさらに検索


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by