MATLAB: How to create for loop to find coefficients of segments

matrix for loop

Hi all. I have a data matrix named: y (150×240)
I'm using each column (150 datas) of that matrix to find some parameters.
For example, for first frame:
y1=y(1:150)
p=10;
[a,g] = lpc(y1,p)
And same for second column(y2=y(151:300)) I need to find [a,g] for all columns. How can I create for loop for this?

Best Answer

Try this:
[rows, columns] = size(y);
p=10;
for col = 1 : columns
thisColumn = y(:, col);
[a(col), g(col)] = lpc(thisColumn, p);
end