4D matrix manipulation

I have a 4D matrix G size of [k*j*i*l] so its G(k,j,i,l) ,
the sizes are:
k=1x365,
j=1x31,
i=1x24,
l=1x91.
For estimation purposes I need a 3D matrix G(k,j-i,l), which I can later also plot.
I did not try anything, since I have no clue how to do it.
Thanks

4 comentarios

Guillaume
Guillaume el 16 de Ag. de 2019
What does G(k, j-i, l) mean for you?
Because, given a 4D array, in matlab, the only meaning is:
G(k, j-i, l, 1)
a scalar element at row k, column j-i, page l, and 4th dimension 1.
madhan ravi
madhan ravi el 16 de Ag. de 2019
Did you delete your question yesterday??? I was searching it for a long time.
Asliddin Komilov
Asliddin Komilov el 17 de Ag. de 2019
Editada: Asliddin Komilov el 17 de Ag. de 2019
sorry for the confusion, the last dimension is not 1 (one) but l (L), j-i is a new dimension that is equal to j-i, but because j-i is for each values of j and i it becomes a matrix j-i(j,i) instead of an array. Here my imagination stops working, I cannot figure out how it should be. Or maybe I am wrong and the solution looks otherwise.
thanks
Asliddin Komilov
Asliddin Komilov el 17 de Ag. de 2019
I did not remove or edit it since the first posted, it must have been a system fault maybe.

Iniciar sesión para comentar.

Respuestas (1)

Star Strider
Star Strider el 16 de Ag. de 2019

0 votos

I am not certain what you want.
Try this:
G = rand(365,31,24,91); % Create ‘G’
Gnew = reshape(G, 365, [], 91); % Desired Result (?)
Experiment to get the result you want.

2 comentarios

Asliddin Komilov
Asliddin Komilov el 17 de Ag. de 2019
thanks, I am on it.
Star Strider
Star Strider el 17 de Ag. de 2019
My pleasure.
If my Answer helped you solve your problem, please Accept it!

Iniciar sesión para comentar.

Categorías

Productos

Versión

R2016a

Preguntada:

el 16 de Ag. de 2019

Comentada:

el 17 de Ag. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by