채택된 답변

Matt J
Matt J 2021년 12월 26일
편집: Matt J 2021년 12월 27일

0 개 추천

Perhaps this is what you want,
sub=repmat({':'},1,n);
sub(i)={1};
Y=W(sub{:});

댓글 수: 2

Hancheng Zhu
Hancheng Zhu 2021년 12월 27일
Nice code, bro. But the second line should be changed into sub{i} = l ;
Matt J
Matt J 2021년 12월 27일
편집: Matt J 2021년 12월 27일
You're right, and I've edited the answer accordingly, but please Accept-click the answer if it provided what you needed.

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

추가 답변 (0개)

카테고리

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

제품

릴리스

R2014b

질문:

2021년 12월 26일

편집:

2021년 12월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by