Borrar filtros
Borrar filtros

Is it possible to concatenate columns of a tensor into a single column?

2 visualizaciones (últimos 30 días)
I am working with a 1000 x 1 x 100 tensor, lets call it A. I want to create a new variable B that containst all the rows of the tensor within a single column, i.e., B=100000 x 1. I have been using vertcat in the following way:
B= vertcat( A(:,:,1),A(:,:,2),..., A(:,:,100));
Although this technique gives me what it need, I believe there is a simpler way to do it. I hope you could suggest me a more practical approach.
Thanks, Rafael

Respuesta aceptada

Chunru el 12 de Nov. de 2021
A =randn(10,1,10);
B = A(:)
B = 100×1
-0.9363 -0.1899 -1.2740 -1.2239 0.5646 -0.1502 -1.0900 0.8784 -0.6796 0.1418

Más respuestas (0)


Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by