Double = in one line of code
조회 수: 2 (최근 30일)
이전 댓글 표시
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;
답변 (2개)
Andrei Bobrov
2019년 8월 13일
b = 1000;
zz = {b};
[a,c] = zz{[1,1]};
댓글 수: 1
Rik
2019년 8월 13일
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.
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!