MATLAB: Error using ==> mrdivide Matrix dimensions must agree.

matrix dimensions must agreemrdivide

Almost Done
A small detail left.
clc;
clear all;
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(5953,1);
B(1,1)=y(1);
for i=2:5953
B(i,1)=y(i);
end
Z=A/B
And my error
Error using ==> mrdivide
Matrix dimensions must agree.
Error in ==> test3 at 28
Z=A/B

Best Answer

Your A is 5955 by 2. You are trying to divide that by something that is 5953 by 1. What size of result were you expecting? 5955 by 2 by 5953 ?
Related Question