# Paulche/num_analysis_labs

1 parent 3982baa commit 2984689dc3b9b44a5d85429c015f30a2b0ae643c committed Mar 21, 2013
Showing with 20 additions and 4 deletions.
1. +13 −0 lab4/action.asv
2. +3 −0 lab4/action.m
3. +2 −2 lab5/iter_method.m
4. +2 −2 lab5/seidel_method.m
13 lab4/action.asv
 @@ -0,0 +1,13 @@ +function action() + + % Draw plot + x = 0.1:0.1:4; + y = f; + H = plot(x,y(x)); + + dsolution = d_solve(1,2,15) + nsolution = n_solve(15,1.1) + fzero_solution = fzero(f,[1 2]) + + derror = abs( +end
3 lab4/action.m
 @@ -8,4 +8,7 @@ function action() dsolution = d_solve(1,2,15) nsolution = n_solve(15,1.1) fzero_solution = fzero(f,[1 2]) + + derror = abs(dsolution - fzero_solution) + nerror = abs(nsolution - fzero_solution) end
4 lab5/iter_method.m
 @@ -1,6 +1,6 @@ function [solution conv serial] = iter_method(A,b,x,n) r = x; - serial = transp(x); + serial = x'; [B c] = compute_bc(A,b); @@ -13,7 +13,7 @@ for i = 1:n x = B * x + c; - serial = [serial; transp(x)]; + serial = [serial; x']; end solution = x;
4 lab5/seidel_method.m
 @@ -1,5 +1,5 @@ function [solution conv serial] = seidel_method(A,b,x,n) - serial = transp(x); + serial = x'; len = length(x); [B c] = compute_bc(A, b); @@ -19,7 +19,7 @@ for i = 1:len x(i) = (b(i) - sum(A(i,1:i-1)*x(1:i-1)) - sum(A(i,i+1:end)*x(i+1:end))) / A(i,i); end - serial = [ serial; transp(x) ]; + serial = [ serial; x' ]; end solution = x;