Unexpected Matlab Expression ?

조회 수: 3 (최근 30일)
Natalie Brehaut
Natalie Brehaut 2017년 9월 11일
댓글: Jose Marques 2017년 9월 11일
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
Jose Marques
Jose Marques 2017년 9월 11일
Nice work!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by