Problem of tensor extraction

1 vue (au cours des 30 derniers jours)
Hancheng Zhu
Hancheng Zhu le 26 Déc 2021
Modifié(e) : Matt J le 27 Déc 2021

Réponse acceptée

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

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Produits


Version

R2014b

Community Treasure Hunt

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

Start Hunting!

Translated by