What is the syntax error in my script?

1 回表示 (過去 30 日間)
Abraham Hernandez
Abraham Hernandez 2020 年 5 月 4 日
コメント済み: Mehmed Saad 2020 年 5 月 4 日
% Problem 5
problem5x=(1 1.25 2 2.5 4 5 10)
problem5y=(200 128 50 32 12.5 8 2)
plot(problem5x,problem5y)
I'm trying to make sets (problem5x and problem5y) to then plot in a graph, but I keep getting a syntax error on the '1.25' in my x line and '128' in my y line. The error code mentions a missing parenthesis somewhere but I can't imagine where I'd be missing one where my errors are being found.

採用された回答

Mehmed Saad
Mehmed Saad 2020 年 5 月 4 日
The problem is with braces. [ ] generate arrays, {} generate cells and () are used for multiple purpose
Read this for more details
  2 件のコメント
Abraham Hernandez
Abraham Hernandez 2020 年 5 月 4 日
Thanks for the help.
Mehmed Saad
Mehmed Saad 2020 年 5 月 4 日

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by