min value of each row with corresponding column

조회 수: 1 (최근 30일)
M
M 2023년 11월 1일
답변: Dyuman Joshi 2023년 11월 1일
How to do the following?
If there are three columns and I want to get the min value of each row and I want to know from which column was this value

채택된 답변

Dyuman Joshi
Dyuman Joshi 2023년 11월 1일
y = magic(3)
y = 3×3
8 1 6 3 5 7 4 9 2
%Utilize the functionality of min()
[m,idx] = min(y, [], 2)
m = 3×1
1 3 2
idx = 3×1
2 1 3

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by