MATLAB: Need to obtain two unknown coefficients

unknown coefficients

load('S_chest.mat');
load('S_abdomen.mat');
x= S_chest;
y= S_abdomen;
A=zeros(5955,2);
A(1,1)=x(1);
for n= 2:5953
A(n,1)= x(n);
A(n,2)= x(n-1);
end
B=zeros(5955,2);
B(1,1)=y(1);
for i=2:5953
B(i,1)=y(i);
end
w= A/B;
w(w==0)= [];
disp(w);
I need to obtain w1, w2. Matlab comes out of many results but I only need two. How am I going to get them?

Best Answer

My guess is that you want
w = A\B(:,1);