Converting a 3D matrix into 2D matrix correctly

7 visualizaciones (últimos 30 días)
R S
R S el 20 de Ag. de 2015
Comentada: Shashwar Kumar el 11 de Abr. de 2018
Given a 2D image I had to create a vector of features for each pixel (i,j). To do that, I created a 3D matrix such that the 3rd dimension is a vector of features for the pixel. For example, (2, 3, :) represents the vector of features for pixel (2,3) in the image .
Now I need to convert this 3D matrix into 2D matrix where each row is a vector of features. I tried to understand the function reshape() but could not get it to work the way I need.
I would appreciate some expert advice
Thank you

Respuesta aceptada

Sean de Wolski
Sean de Wolski el 20 de Ag. de 2015
feat = reshape(x,size(x,1)*size(x,2),size(x,3))
  2 comentarios
Christine  Zarief
Christine Zarief el 10 de Mzo. de 2018
I have a problem I need to convert 3D matrix into 2D , 580 x 306 x 375 I want to convert it to 306*375 I mean I want to remove the first one ,how I can do it ? Thanks in advance

Iniciar sesión para comentar.

Más respuestas (1)

R S
R S el 20 de Ag. de 2015
Thank you !!

Categorías

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

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by