필터 지우기
필터 지우기

Vector array from matrix

조회 수: 3 (최근 30일)
SANTHOSH s
SANTHOSH s 2019년 11월 29일
편집: Dhananjay Kumar 2019년 12월 4일
Can anyone suggest me the general code for finding the difference between maximum and minimum value in a higher order matrix to get each row answers in vector form.
  댓글 수: 2
JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH 2019년 11월 29일
can you give a short example please?
dpb
dpb 2019년 11월 29일
Use the optional argument to the min max functions to operate on the desired dimension...

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

채택된 답변

Dhananjay Kumar
Dhananjay Kumar 2019년 12월 4일
편집: Dhananjay Kumar 2019년 12월 4일
If A = [1 0 5; 6 -9 -5; 1 2 5; 0 0.9 -2]
then min(A,[],2) gives a column vector containing minimum value of each row. Similarly for max(A,[],2).
>> min(A,[],2)
ans =
0
-9
1
-2
(Here third argument is to specify dimension along which to find min/max)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by