y=e.^(-2*t​ime)*[24*c​os(4*time)​-40*sin(4*​time)]

error using *, inner matrix dimensions must agree, could you correct for errors??

Answers (1)

James Tursa
James Tursa on 15 Sep 2015
Edited: James Tursa on 15 Sep 2015

Try this:

y=e.^(-2*t​ime).*[24*c​os(4*time)​-40*sin(4*​time)] % <-- changed )*[ to ).*[

1 Comment

Right.
When you use [] then everything is sensitive to spacing. In particular if you had
[24*cos(4*time) -40*sin(4*time)]
then it could interpret that as being a two-element row vector, 24*cos(4*time) and -40*sin(4*time)

Sign in to comment.

Categories

Find more on Operators and Elementary Operations in Help Center and File Exchange

Asked:

on 15 Sep 2015

Commented:

on 15 Sep 2015

Community Treasure Hunt

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

Start Hunting!