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

—Utpal Kumar (IES, Academia Sinica)

Search
#
Institute of Earth Sciences Coders

### Let's code!

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

—Utpal Kumar (IES, Academia Sinica)

%d bloggers like this:

October 21, 2016 at 8:12 am

G=[ones(N,1),t]; what does it mean ones?.

I don’t understand this expression… 😛

LikeLike

October 21, 2016 at 8:28 am

@Rocio: “ones” is a function in MATLAB that creates a matrix of values 1. Here, ones(N,1) will create a N (rows) x 1(column) matrix of 1. G is the matrix of coefficient values of the model. For fitting a straight line, the model is v = 1.m1 + t.m2.

LikeLike