What's wrong with the folow expression?

Matlab don't accept y=exp(-x)+exp(-0.5*x)*(-0.5*cos(3*x)-3*sin(3*x))
Error using * Inner matrix dimensions must agree.
what's wrong with this?

 Accepted Answer

Use .*
x=0:10
y=exp(-x)+exp(-0.5*x).*(-0.5*cos(3*x)-3*sin(3*x))

More Answers (0)

Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!