[Scilab-users] concatenate hypermatrices along the 3rd dimension
antoine.monmayrant at laas.fr
antoine.monmayrant at laas.fr
Mon Oct 8 14:13:37 CEST 2018
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"?
Thanks in advance,
Antoine
PS: If you are curious, I'm looking at the time evolution of a 2D image
and need to do zero-padding and fft for spectral analysis : the 2 first
dimensions are space ones (x,y), while the 3rd one is temporal evolution.
--
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
Antoine Monmayrant LAAS - CNRS
7 avenue du Colonel Roche
BP 54200
31031 TOULOUSE Cedex 4
FRANCE
Tel:+33 5 61 33 64 59
email : antoine.monmayrant at laas.fr
permanent email : antoine.monmayrant at polytechnique.org
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
More information about the users
mailing list