Linearize nonlinear state space equation in MATLAB at steady state setpoint
This post shows one way to linearize a nonlinear state equation at a steady state setpoint in MATLAB. It is assumed that a function ode.m exists in which the state equation is implemented:
function dx = ode(t, x, u) % example ODE dx1 = tan(x(4)) * x(2) + 2*u(2) - 1; dx2 = x(1) - sin(x(2)); dx3 = 13 * x(4) + u(1) + 1; dx4 = 2*x(1); dx = [dx1; dx2; dx3; dx4]; end
Calculate Levenshtein distance in MATLAB (words or characters) with Wagner–Fischer algorithm
This is a MATLAB implementation of the Wagner–Fischer algorithm.