How to connect 3 variables logically?

1 Ansicht (letzte 30 Tage)
GettinStarted
GettinStarted am 4 Jul. 2020
Kommentiert: GettinStarted am 4 Jul. 2020
Hello Community,
I'm pretty sure my issue isn't that hard to figure out... nonethless I don't get it.
Let's say I do have a lenght L which consists of Lenght l1 and Lenght l2 of equally lenght.
The lenght L1 and L2 are used for a loop in the script. So I want to type in L=2 and the result should automatically be: l1=1 and l2=1
Thanks in adance.

Akzeptierte Antwort

madhan ravi
madhan ravi am 4 Jul. 2020
L = 2;
[L1, L2] = deal(L / 2)
  1 Kommentar
GettinStarted
GettinStarted am 4 Jul. 2020
Hello madhan ravi,
thank you very much! deal :D

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Workspace Variables and MAT-Files finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by