필터 지우기
필터 지우기

I can not create a matrix

조회 수: 1 (최근 30일)
Muhendisleksi
Muhendisleksi 2017년 3월 27일
편집: Andrei Bobrov 2017년 3월 27일
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!

채택된 답변

Andrei Bobrov
Andrei Bobrov 2017년 3월 27일
편집: Andrei Bobrov 2017년 3월 27일
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;

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by