フィルターのクリア

How do I declare E=[1,-7,3,-9,5]

1 回表示 (過去 30 日間)
Reynaldo Ponce
Reynaldo Ponce 2019 年 2 月 25 日
回答済み: Bob Thompson 2019 年 2 月 25 日
for an assignment I was given
  1. Declare and suppress the output of the following variables in the most succinct manner possible:
A=[1,2,3,4,5]
B=[2,5,8,11,14]
C=[20, 15, 10, 5, 0]
D =[-5, -4, -3, -2, -1]
E = [1, -7, 3, - 9, 5]
I did
A=[1:5]
B=[2:3:14]
C=[20:-5:0]
D=[-5:-1]
but for E I couldnt figure it out, any suggestions please.

採用された回答

Bob Thompson
Bob Thompson 2019 年 2 月 25 日
You can define each element of an array individually if you would like. Defining E should be pretty much exactly as it is listed.
E = [1, -7, 3, - 9, 5]; % For a single row array. Use ';' between elements for a single column array.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEntering Commands についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by