Unexpected Matlab Expression ?

1 Ansicht (letzte 30 Tage)
Natalie Brehaut
Natalie Brehaut am 11 Sep. 2017
Kommentiert: Jose Marques am 11 Sep. 2017
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 Kommentare
Natalie Brehaut
Natalie Brehaut am 11 Sep. 2017
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 am 11 Sep. 2017
I am supposed to code the function E(x)= plus or minus 3e^(-x/4)

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Jose Marques
Jose Marques am 11 Sep. 2017
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 Kommentare
Natalie Brehaut
Natalie Brehaut am 11 Sep. 2017
THAT WORKED THANK YOU SO MUCH
Jose Marques
Jose Marques am 11 Sep. 2017
Nice work!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Multidimensional Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by