Error: Line: 9 Column: 19 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.

clear all
close all
x=-2:0.1:2;
y=exp(x^2)*cos(20x);
plot(y,x)
xlabel('x')
ylabel('y')
title('y=exp(x^2)*cos(20x) in the range of x=-2:0.1:2')
grid on
Trying to write a script to compute the function y=exp (x2)*cos (20x) in the range x= -2: 0.1:2. and plot a subsequent graph with the results.

 採用された回答

Birdman
Birdman 2020 年 3 月 25 日
x=-2:0.1:2;
y=exp(x.^2).*cos(20.*x);
plot(y,x)

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeFunctions についてさらに検索

製品

リリース

R2019b

質問済み:

2020 年 3 月 25 日

コメント済み:

2020 年 3 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by