Borrar filtros
Borrar filtros

I can not create a matrix

1 visualización (últimos 30 días)
Muhendisleksi
Muhendisleksi el 27 de Mzo. de 2017
Editada: Andrei Bobrov el 27 de Mzo. de 2017
BNdog =[23;107;108;23;107;108]
YON_BLNM =[23;107;108]
ri=[0;124.5383;0;32.2448;0;43.2158]
Z =[186.6933;354.4481;111.2320]
Z=[Z;Z]
for i = 1:length(YON_BLNM)
Zi{i} = Z(BNdog==YON_BLNM(i),1);
end
Zi=cell2mat(Zi')
t_den=Zi+ri
t_den = [186.6933; 311.2316; 354.4481; 386.6929; 111.2320; 154.4478]
It is formed in this way. But it has to be this way;
t_den = [111.2320; 154.4478; 354.4481; 386.6929; 186.6933; 311.2316]
Please help me!

Respuesta aceptada

Andrei Bobrov
Andrei Bobrov el 27 de Mzo. de 2017
Editada: Andrei Bobrov el 27 de Mzo. de 2017
BNdog =[23;107;108;23;107;108];
YON_BLNM =[23;107;108];
ri=[0;124.5383;0;32.2448;0;43.2158];
Z =[186.6933;354.4481;111.2320];
Z =[Z;Z];
r = reshape(flip(reshape(ri,2,[]),2),[],1);
Y = flip(YON_BLNM);
[~,ii] = ismember(BNdog,Y);
[~,i2] = sort(ii);
t_den = Z(i2) + r;

Más respuestas (0)

Categorías

Más información sobre Descriptive Statistics en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by