Expression or statement is incorrect--possibly unbalanced

I'm trying to use plot, but I keep getting this error and I'm not sure why.
n = [0:99];
omega = 1.26 * pi;
xn = sin(omega*n);
plot = (n,xn);
xlabel = ('Time Index, n');
ylabel = ('Amplitude');
axis = ([0 99 -1 1]);
??? plot = (n,xn);
|
Error: Expression or statement is incorrect--possibly unbalanced (, {, or [.

1 件のコメント

Stephen23
Stephen23 2017 年 6 月 12 日
編集済み: Stephen23 2017 年 6 月 12 日
plot = (n,xn);
xlabel = ('Time Index, n');
ylabel = ('Amplitude');
axis = ([0 99 -1 1]);
Wow... what dodgy youtube "tutorial" or random teenager's blog showed that incredibly bad syntax and variable naming? Is finding the MATLAB documentation so difficult?

サインインしてコメントする。

 採用された回答

Guillaume
Guillaume 2014 年 9 月 12 日

0 投票

plot(n, xn);

4 件のコメント

Dick Rusell
Dick Rusell 2014 年 9 月 12 日
I still get the same error.
José-Luis
José-Luis 2014 年 9 月 12 日
You shouldn't if you delete the equal sign.
Dave Jack
Dave Jack 2017 年 6 月 12 日
I have an same problem and I have no idea to solve it
Steven Lord
Steven Lord 2017 年 6 月 12 日
Show a small segment of code with which you can reproduce the error and the full text (everything in red) of the error message you receive when you execute that small segment of code.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

質問済み:

2014 年 9 月 12 日

コメント済み:

2017 年 6 月 12 日

Community Treasure Hunt

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

Start Hunting!

Translated by