採用された回答

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 件)

カテゴリ

製品

リリース

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