Finding location of minimum in 3d array
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
DARLINGTON ETAJE
am 14 Aug. 2019
Kommentiert: DARLINGTON ETAJE
am 14 Aug. 2019
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
0 Kommentare
Akzeptierte Antwort
KSSV
am 14 Aug. 2019
It is asked multiple times..you may search in the forum. For EXample:
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Linear Algebra finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!