What is wrong with the indexing

syms s t Y
f=[sin(t)-heaviside(t-2*pi)*sin(t-2*pi)]
eqn=sym(diff(y, t, 2)+y*y(t)==f)
lteqn=laplace(eqn, t, s)
neweqn=subs(lteqn, {laplace(y(t), t, s), y(0), diff(y,t)(0)}, {Y, 0, 0})
receiving error saying ()-indexing must appear last in an indexing expression

Answers (1)

Stephen23
Stephen23 on 17 Nov 2018
MATLAB does not allow parentheses to trail other parentheses, so this is now allowed:
diff(y,t)(0)
You will have to use a temporary variable to store that data before indexing into it.

Asked:

on 17 Nov 2018

Answered:

on 17 Nov 2018

Community Treasure Hunt

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

Start Hunting!