matlab - Inner matrix dimensions error must agree error when plotting -
i'm attempting plot function: f(x) = x * e^(x) * cos(x) 0 2*pi. i've tried running:
x = 0:pi/100:2*pi; y = x*exp(x)*cos(x)
however, every time attempt set y. matlab throws me 'error using *' , says inner matrix dimensions must agree. insight why happens?
you have use .*
(element-wise multiplication), not *
(matrix multiplication)
Comments
Post a Comment