Finding location of minimum in 3d array

조회 수: 8 (최근 30일)
DARLINGTON ETAJE
DARLINGTON ETAJE 2019년 8월 14일
댓글: DARLINGTON ETAJE 2019년 8월 14일
Consider this code
Y = rand(1000,100) ;
iwant = zeros(20,50,100) ;
uwant=zeros(50,1,100);
for i = 1:100
Y1 = Y(:,i) ;
S1 = numel(Y1); % this is same always 1000
iwant(:,:,i) = reshape(Y1(1:S1 - mod(S1, 20)), 20, []);
uwant(:,:,i) = sum(iwant(:,:,i), 1).' / 20;
A=uwant(:,:,1:100);
B=abs(A-z);
C=min(B,[],[2 3]);
end
C is 50 by 1. Each value in C is selected from each row of 100 variables. How can I know the location where C is taking from among the 100 variables

채택된 답변

KSSV
KSSV 2019년 8월 14일
It is asked multiple times..you may search in the forum. For EXample:
  댓글 수: 2
DARLINGTON ETAJE
DARLINGTON ETAJE 2019년 8월 14일
Thanks for your response...the code there doesnt work...please help me with codes specific to this question.
DARLINGTON ETAJE
DARLINGTON ETAJE 2019년 8월 14일
please help me out

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by