Borrar filtros
Borrar filtros

Store data in matrix form matlab

1 visualización (últimos 30 días)
MatlabFan
MatlabFan el 20 de Jun. de 2013
Hi everybody,
I have four 4 dimensional vector Trgt_minmax, Pers_minmax, Trgt_avgr,and Pers_avgr.
to give you an idea of how the elements in these vectors are organized, typing Trgt_avgr(2,:,:,1) at the command prompt outputs the following:
ans(:,:,1) =
0.7811
ans(:,:,2) =
0.3668
ans(:,:,3) =
0.4283
ans(:,:,4) =
0.6220
ans(:,:,5) =
0.4005
Hey, I almost forgot. Here are the sizes of the four four dimensional vectors: Trgt_avgr=16x1x5x4 Pers_avgr=16x1x10x4 Trgt_minmax=16x2x5x4 Pers_minmax=16x2x10x4
Now, my question.
I would like to create a 15x3xn matrix that is filled as such:
for i=1 through n
the first 5 elements of the 1st column are Trgt_minmax(n,1,:,1), the last 10 elements of the 1st column are Pers_minmax(n,1,:,1); the first 5 elements of the 2nd column are Trgt_minmax(n,2,:,1), the last 10 elements of the 2nd column are Pers_minmax(n,2,:,1);then, the first 5 elements of the 3rd column are Trgt_avgr(n,:,:,1), the last 10 elements of the 3rd column are Pers_avgr(n,:,:,1).
I tried all I could, but the fact that for each n, Targt_avgr(n,:,:,1) outputs a result with the ans(:,:,1), ans(:,:,2),...,ans(:,:,k) really gives me trouble. And I face this difficulty for all the four 4D vectors.
Your help, as always I appreciate.
Thanks.

Respuestas (0)

Categorías

Más información sobre Matrix Indexing 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