Reputation: 135
I'm trying to enter this expression in MATLAB, and I get the error:
Error: Unbalanced or unexpected parenthesis or bracket.
y = (exp(t./10)*sin(t.))./(t.^2 + 1)
I'm new to MATLAB and not quite sure what's going wrong there.
Upvotes: 0
Views: 119
Reputation: 104464
Remove the extra dot inside sin(t.)
.... sin(t)
. Also, it's a good idea to add a dot before the *
operator if you want this to be element-wise, just like the rest of your operations:
y = (exp(t./10).*sin(t))./(t.^2 + 1)
To show that this works:
>> t = 0:10;
>> y = (exp(t./10).*sin(t))./(t.^2 + 1)
y =
Columns 1 through 7
0 0.4650 0.2221 0.0190 -0.0664 -0.0608 -0.0138
Columns 8 through 11
0.0265 0.0339 0.0124 -0.0146
Upvotes: 1