Cell Array Search and indexing
조회 수: 5 (최근 30일)
이전 댓글 표시
Hello,
Please how do I find the maximum column in a cell array and assign the index position to other variables?
i = 1:5
j = 1:8
AllOutput{1,i}{1,j};
max([AllOutput{1,i}{1,2}],[],2) % Tried this but cannot seem to get it to work through all the i matrix
DT_values = AllOutput{1,i}{1,2}; % find the maximum column from all the ith array
maximum = ((max(DT_values,[],2)));
[M,I]=find(DT_values==maximum);
Dr_opt = AllOutput{1,i}{1,3};
Output= Dr_opt(I); %Assign other variables to the same index position as above
댓글 수: 1
답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!