MATLAB Answers

Error using _*_. What am I doing wrong?

24 views (last 30 days)
Atli Tobiasson
Atli Tobiasson on 19 Feb 2021
Commented: Alan Stevens on 19 Feb 2021
t = linspace(t1,10,200);
x(t) = ((F0*exp((-zeta*omega*t.)))/(k*sqrt(1-zeta^2)))*((exp(zeta*omega*t1)*cos(omega*(t.-t1))-phi)-cos(omega*t.-phi));
First I got this error
Error using *
Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix
matches the number of rows in the second matrix. To perform elementwise multiplication, use '.*'.
Then I added '.*' after every 't' and now I get the following error. Where am I getting this wrong?
Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check
for mismatched delimiters.

Answers (1)

Alan Stevens
Alan Stevens on 19 Feb 2021
You need dots before the * and before the / , not after the t.
Alan Stevens
Alan Stevens on 19 Feb 2021
You will need to post your full code for anyone to be able to resolve your further error.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!