The following tutorials are an introduction to solving linear and nonlinear equations with MATLAB. The solution to linear equations is through matrix operations while sets of nonlinear equations require a solver to numerically find a solution.
Solve Linear Equations with MATLAB
Solve Nonlinear Equations with MATLAB
% Create new file myFunction.m function F=myFunction(z) x = z(1); y = z(2); F(1)=x^2+y^2-20; F(2)=y - x^2; end % Create new file mySolver.m clear all zGuess = [1; 1]; z = fsolve(@myFunction, zGuess); disp(z)
comments powered by Disqus