原创 Matlab實現——Lagrange approximation

歡迎前往個人博客 駑馬點滴 和視頻空間 嗶哩嗶哩-《挨踢日誌》  lagran.m %Program 4.1 (Lagrange approximation) function [C,L]=lagran(X,Y) %Input

原创 Matlab實現——Adams-Bashforth-Method

歡迎前往個人博客 駑馬點滴 和視頻空間 嗶哩嗶哩-《挨踢日誌》 abm.m   function A = abm(f,T,Y) %Input - f is the function entered as a string 'f'

原创 輸出2-n的所有素數

歡迎前往個人博客 駑馬點滴 和視頻空間 嗶哩嗶哩-《挨踢日誌》 有這麼幾個方法: 1.對於2-n的每一個數,判斷是否爲素數,是則輸出。 ——判斷k是否爲素數的時候得從 2 到 (int)(sqrt(k))遍歷,算法通俗易懂 void O

原创 Matlab實現——求矩陣的逆(LU分解)

歡迎前往個人博客 駑馬點滴 和視頻空間 嗶哩嗶哩-《挨踢日誌》 Program  ( :Solve By Factorization with Pivoting ) 思路及原理: 就得到: 程序: function X=Ni(A)

原创 ACM ICPC 3252 Round Numbers

歡迎前往個人博客 駑馬點滴 和視頻空間 嗶哩嗶哩-《挨踢日誌》   【序言】剛剛開始學,想找些簡單的題目入手,看到這題AC的人挺多,於是我也來做做這題。 【題目】   Time Limit: 2000MS   Memory Limit:

原创 Matlab實現——嚴格對角佔優三對角方程組求解(高斯賽爾德Gauss-Seidel迭代、超鬆弛)

歡迎前往個人博客 駑馬點滴 和視頻空間 嗶哩嗶哩-《挨踢日誌》 嚴格對角佔優三對角方程組求解 對中等規模的n階的(n<100)線性方程組,直接法的準確性和可靠性,所以常採用直接法 對於較高階的方程組,特別是地於某些偏微分方程離散化後得到的

原创 Matlab實現——to find the fixed point

歡迎前往個人博客 駑馬點滴 和視頻空間 嗶哩嗶哩-《挨踢日誌》 fixpt.m   function [k,p,err,P]=fixpt(g,p0,tol,max1) % Input - g is the iteration func

原创 Matlab實現——捕食者-被捕食者模型

歡迎前往個人博客 駑馬點滴 和視頻空間 嗶哩嗶哩-《挨踢日誌》 問題重述: 捕食者-被捕食者模型非線性微分方程的一個例子是捕食者-被捕食者模型。設x(t)和y(t)分別表示兔子和狐狸在時刻t的數量,捕食者-被捕食者模型表明,x(t)和y(

原创 Matlab實現——Recursive Trapezoidal Rule

歡迎前往個人博客 駑馬點滴 和視頻空間 嗶哩嗶哩-《挨踢日誌》 rctrap.m %Program 7.3 (Recursive Trapezoidal Rule). function T=rctrap(f,a,b,n,tol) %

原创 Matlab實現——Euler's Method

歡迎前往個人博客 駑馬點滴 和視頻空間 嗶哩嗶哩-《挨踢日誌》 euler.m %Program9.1 (Euler's Method) function E=euler(f,a,b,ya,M) %Input - f is the

原创 Matlab實現——Forward-substitution

歡迎前往個人博客 駑馬點滴 和視頻空間 嗶哩嗶哩-《挨踢日誌》 %Program 3.1.1 (Forward-substitution) function X=forwardsub(A,B) %Input - A is an n

原创 Matlab實現——Upper Triangularization Followed by Back Subtitution

歡迎前往個人博客 駑馬點滴 和視頻空間 嗶哩嗶哩-《挨踢日誌》   uptrbk.m     %Program 3.2 (Uppr Triangularization Followed by Back Subtitution) f

原创 Matlab實現——Adaptive Quadrature Using Simpson’s Rule

歡迎前往個人博客 駑馬點滴 和視頻空間 嗶哩嗶哩-《挨踢日誌》 %Input - f is the integrand input as a string ¡¯f¡¯ % - a and b are upper and lower

原创 Matlab實現——Jacobi Iteration and Gauss-Seidel Iteration

歡迎前往個人博客 駑馬點滴 和視頻空間 嗶哩嗶哩-《挨踢日誌》 Use Jacobi Iteration and Gauss-Seidel Iteration to solve the following linear system w

原创 Matlab實現——Newton-Raphson Iteration

歡迎前往個人博客 駑馬點滴 和視頻空間 嗶哩嗶哩-《挨踢日誌》 Newton.m %Program 2.5 (Newton-Raphson Iteration) function [p0,err,k,y]=newton(f,df,