Using a Function (MATLAB)

If we need to run the same algorithms or formula for computations again and again, then instead of writing the same stuffs in our script file many times, we can simply write a function. This makes our script look simpler and faster to run.

Writing a function in MATLAB

Examples:

Calculating mean and standard deviation

Calculating distance from origin

Calculates distance (in km) between two coordinate points on the Earth’s surface

Continue reading Using a Function (MATLAB)

Constrained Least Square Fitting

Let us try to understand the least square fitting method using an example:

Example

Continue reading Constrained Least Square Fitting