Notes of my Numerical Techniques module at University - also learning MATLAB
Warning
there is difference between % and %% One percent sign ( % ) is used for commenting lines. Two percent signs ( %% ) have a different purpose: they are used for dividing your code into sections, which can be run independently. This allows easier debugging.
Note
Some Important Functions to understand :-
vpa()is a function to get the answers in decimal formsubs(s,new)returns a copy ofs, replacing all occurrences of the default symbolic scalar variable inswithnew, and then evaluates s.% for exmaple syms X; equation = (3 + X); ans = subs(equation,5); % ans will be equal 8symsThe syms function creates a variable dynamically. For example,syms xcreates the symbolic variablexand automatically assigns it to a MATLAB variable with the same name.linsolve()takes two matrices and solve their equation