How can I extract all matrix elements for one index with dynamic number of dimenstions?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Philipp
am 6 Apr. 2017
Kommentiert: Philipp
am 6 Apr. 2017
Hello experts,
let A be
A = rand(4, 4, 4); %
so what I want is:
B = reshape(A(1,:,:), [4 4])
The problem is the unknown dimension of A. So if A has the dimension of 3, I need 2 colon operator; if 4 then 3 and so on...
I am very thankful for any ideas...
BR
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!