フィルターのクリア

How to distribute elements of a vector to each of output variable?

14 ビュー (過去 30 日間)
hmhuang
hmhuang 2021 年 12 月 7 日
編集済み: Stephen23 2021 年 12 月 7 日
x = [1,2,3,4,5]
x = 1×5
1 2 3 4 5
[a,b,c,d,e] = deal(x(1:5))
a = 1×5
1 2 3 4 5
b = 1×5
1 2 3 4 5
c = 1×5
1 2 3 4 5
d = 1×5
1 2 3 4 5
e = 1×5
1 2 3 4 5
How do I write code such that a=1, b=2, c=3, d=4, e=5?
  1 件のコメント
KSSV
KSSV 2021 年 12 月 7 日
Why you want this? You can access them using x(1), x(2)...x(5) etc.

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

回答 (1 件)

Stephen23
Stephen23 2021 年 12 月 7 日
編集済み: Stephen23 2021 年 12 月 7 日

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by