Unexpected Matlab Expression ?

3 次查看(过去 30 天)
I am new to coding and am unsure why my code does not work it says "Unexpected MATLAB expression" for the 3 in my code.
This is my code E(x)= [-1 1] 3 . * exp (1) . ^ ((-x)./4)
Any help is appreciated
  4 个评论
Natalie Brehaut
Natalie Brehaut 2017-9-11
it is supposed to be an envelope to another function, I have tried to add .* in between but that comes up as unexpected MATLAB Operator
Natalie Brehaut
Natalie Brehaut 2017-9-11
I am supposed to code the function E(x)= plus or minus 3e^(-x/4)

请先登录,再进行评论。

采纳的回答

Jose Marques
Jose Marques 2017-9-11
Natalie, try this:
E= [-1 1] * 3 *( exp (1) .^ ((-x)/4))
E will be a matrix 1x2 that first element is positive value and second will be the negative value
  7 个评论
Natalie Brehaut
Natalie Brehaut 2017-9-11
THAT WORKED THANK YOU SO MUCH

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by