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

4 Ansichten (letzte 30 Tage)
hmhuang
hmhuang am 7 Dez. 2021
Bearbeitet: Stephen23 am 7 Dez. 2021
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?

Antworten (1)

Stephen23
Stephen23 am 7 Dez. 2021
Bearbeitet: Stephen23 am 7 Dez. 2021

Kategorien

Mehr zu FPGA, ASIC, and SoC Development finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by