How do i create a 3d matrix?

2 vues (au cours des 30 derniers jours)
Nicky
Nicky le 16 Mai 2013
I have 26 .dat files and 26 .mat files with both the same data. Each file contains a matrix with 32 rows and 32 columns, so 32x32. How do I create a new file with a 3d matrix, with the files in the 3rd dimension, 32x32x26?

Réponse acceptée

Walter Roberson
Walter Roberson le 16 Mai 2013
YourMatrix = zeros(32, 32, 26);
for K = 1 : 26
....
YourMatrix(:,:,K) = input data for this matrix
end

Plus de réponses (0)

Catégories

En savoir plus sur Multidimensional Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by