MATLAB: Matrix dimension problem with integrals

matrix problem integram

Matrix dimensions must agree. Can't figure out what's the prob. Tried a lot,but nothing helped.

Best Answer

The easiest way to solve that is to use the linspace function to define ‘x’ and ‘y’. It allows you to specify the length of the vector, varying the increment to accomodate that. (The colon operator fixes the increment and lets the length vary.)
Related Question