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
Andrei Bobrov 2019년 8월 13일

2 개 추천

b = 1000;
zz = {b};
[a,c] = zz{[1,1]};

댓글 수: 1

Rik
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.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Instrument Control Toolbox에 대해 자세히 알아보기

태그

질문:

2019년 8월 13일

댓글:

2019년 8월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by