Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Please help me make this easy plot work

1 回表示 (過去 30 日間)
Gil
Gil 2014 年 10 月 27 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
  1. f = exp(-0.5*x^2);
  2. t = 0.5;
  3. g_t = exp(-x-3t).^2;
  4. h_t = exp(-x.^2+t).^2;
  5. figure
  6. hold all
  7. plot(f,’r’)
  8. plot(g_t)
  9. plot(h_t,’g’)
  10. xlim([25 60])
  11. grid on
Error: File: plusen.m Line: 3 Column: 15 Unexpected MATLAB expression.

回答 (1 件)

Ben11
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).

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by