MATLAB: Matrix dimesions must agree.

matrix dimesions

Why I do get error Matrix dimensions must agree?
t = (0:5:60);
a = (0:10:100);
s = (a.*t.^2)./2;
p1 = plot(a,s);

Best Answer

The number of the elements in t and a must be equal. It appears you meant to write
t = 0:5:50;