Double = in one line of code
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Can I define a=b=c in one line of code in matlab? if yes what is the syntax?
I do not want to define in double section like a=b; c=b;
1 Kommentar
Antworten (2)
Andrei Bobrov
am 13 Aug. 2019
b = 1000;
zz = {b};
[a,c] = zz{[1,1]};
1 Kommentar
Rik
am 13 Aug. 2019
Nice hack, although I think deal is more clear when reading the code. I didn't know this syntax also generated a comma-separated list like {:} does.
Siehe auch
Kategorien
Mehr zu Logical 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!