MATLAB: Dimensional error while running the code from matlab documentation

dimensionMatrixVB

fs = 1e3;
t = 0:1/fs:1;
x = [2 1 2]*sin(2*pi*[50 150 250]'.*t) + randn(size(t))/10;
in this code the dimension of the t mismatches with [50 150 200]'. how could i possibly get the output without dimesnsional error?

Best Answer

This code should run without error in R2016b and later due to implicit expansion, as t is a row vector and [50 150 200]' is a column vector. This is similar to
>> [1;2].*[1:10]
ans =
1 2 3 4 5 6 7 8 9 10
2 4 6 8 10 12 14 16 18 20
which might also be expected to result in an error.