Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Please help me make this easy plot work
조회 수: 1 (최근 30일)
이전 댓글 표시
- f = exp(-0.5*x^2);
- t = 0.5;
- g_t = exp(-x-3t).^2;
- h_t = exp(-x.^2+t).^2;
- figure
- hold all
- plot(f,’r’)
- plot(g_t)
- plot(h_t,’g’)
- xlim([25 60])
- grid on
Error: File: plusen.m Line: 3 Column: 15 Unexpected MATLAB expression.
댓글 수: 0
답변 (1개)
Ben11
2014년 10월 27일
편집: Ben11
2014년 10월 27일
Please format your code in the question.
The error occurs because MATLAB does not recognize 3t as an expression. You need to use 3*t. (and define x as well but I guess you did it). And don't forget to use element-wise operations when dealing with arrays (eg .^ instead of ^ only).
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!