Problem of tensor extraction

2 Ansichten (letzte 30 Tage)
Hancheng Zhu
Hancheng Zhu am 26 Dez. 2021
Bearbeitet: Matt J am 27 Dez. 2021

Akzeptierte Antwort

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Mathematics finden Sie in Help Center und File Exchange

Produkte


Version

R2014b

Community Treasure Hunt

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

Start Hunting!

Translated by