필터 지우기
필터 지우기

Jacobi method in matlab

조회 수: 2 (최근 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));
end
end
endfunction
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 CenterFile Exchange에서 Spline Postprocessing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by