[Scilab-users] Re : concatenate hypermatrices along the 3rd dimension
sgougeon at free.fr
sgougeon at free.fr
Mon Oct 8 15:30:48 CEST 2018
Hello Antoine,
Please check cat(3, ..) to concatenate along the 3rd (or any) dimension.
Please check resize_matrix() to padd an hypermatrix (with what you want).
Regards
Samuel
----- Mail d'origine -----
De: antoine monmayrant <antoine.monmayrant at laas.fr>
À: International users mailing list for Scilab. <users at lists.scilab.org>
Envoyé: Mon, 08 Oct 2018 14:13:37 +0200 (CEST)
Objet: [Scilab-users] concatenate hypermatrices along the 3rd dimension
Hi all,
I'm trying to stack (or concatenate) 3D matrices (hypermatrices) along
the 3rd dimension.
(The goal is to perform zero-padding along the 3rd dimension).
So far, the only - and ugly - solution I've found is the following:
//my padding
a=zeros(2,2,3);
//my data
b=a;
b(:,:,1)=[111,112;121,122];
b(:,:,2)=[211,212;221,222];
b(:,:,3)=[311,312;321,322];
// zero-padded data
padded_b=matrix([a(:);b(:);a(:)],[size(a,1),size(a,2),3*size(a,3)]);
Is there a solution that is less convoluted (and maybe more efficient)
than resorting to this mix of "(:)" and "matrix"?
More information about the users
mailing list