x = -2:0.1:2;
y = cos(x)+exp(-1/2*x.^2)*sin(6*x)
plot(x,y)
This is my code, I keep getting
Error in test (line 2) y = cos(x)+exp(-1/2*x.^2)*sin(6*x);
But I cant figure out what I am doing wrong.

 채택된 답변

Stephan
Stephan 2018년 9월 16일
편집: Stephan 2018년 9월 16일

0 개 추천

x = -2:0.01:2;
y = cos(x)+exp(-1/2*x.^2).*sin(6*x);
plot(x,y)

댓글 수: 2

Thank you!
Neelanjan Pal
Neelanjan Pal 2019년 11월 16일
편집: Neelanjan Pal 2019년 11월 16일
when the code is as SUCH;
syms x y C
x = -2:0.01:2;
C=12/(cos(x)+exp(-1/2*x.^2).*sin(6*x));
plot(x,C)
error:
Error using /
Matrix dimensions must agree.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기

태그

질문:

2018년 9월 16일

편집:

2019년 11월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by