# kirchhoff_exercise_01.m # This script solves a simple LES resulting from Kirchhoff's laws. # Example from NunezPhysics video tutorial: https://www.youtube.com/watch?v=zdE7xsbuNTg # R. Becker, 2015-04-12 # A*x = b <=> x = A^-1 * b (another notation x = A\b) A = [-1 -1 1 ; -6 3 0 ; 0 -3 -6] b = [0 -24 -12]' # ' means "transpose". Here result is column vector x = A\b # alternative: # x = A^-1 * b # or # x = inv(A) * b