필터 지우기
필터 지우기

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

조회 수: 7 (최근 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 CenterFile Exchange에서 Develop 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