Problem of tensor extraction

2 visualizzazioni (ultimi 30 giorni)
Hancheng Zhu
Hancheng Zhu il 26 Dic 2021
Modificato: Matt J il 27 Dic 2021

Risposta accettata

Matt J
Matt J il 26 Dic 2021
Modificato: Matt J il 27 Dic 2021
Perhaps this is what you want,
sub=repmat({':'},1,n);
sub(i)={1};
Y=W(sub{:});
  2 Commenti
Hancheng Zhu
Hancheng Zhu il 27 Dic 2021
Nice code, bro. But the second line should be changed into sub{i} = l ;
Matt J
Matt J il 27 Dic 2021
Modificato: Matt J il 27 Dic 2021
You're right, and I've edited the answer accordingly, but please Accept-click the answer if it provided what you needed.

Accedi per commentare.

Più risposte (0)

Prodotti


Release

R2014b

Community Treasure Hunt

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

Start Hunting!

Translated by