MATLAB: How to Calculate linear trend for each column of a matrix

linear

Can we calculate the linear trend of each column of a matrix without drawing any line,
For example I want to calculate the linear trend for the column a,b,c,d,e of the attached data
Thank you for any tips or help

Best Answer

Try this:
[D,S] = xlsread('test.xlsx');
B = [(1:size(D,1))', ones(size(D,1),1)] \ D
producing:
B =
-0.7307 -0.6702 -0.5743 -0.5264 -0.3016
38.1515 33.7212 35.0423 35.3009 35.6209
The first row are the slopes and the second row are the intercepts. The columns are for ā€˜aā€™ through ā€˜eā€™ respectively.