Maximun Value in Vectors
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello!, I have a column vector that has a variable, I mean this vector has a function that depends on t (time). I want to give a range of time for example 1 to 10 sec and obtain the maximun value of each row and the time it happens.
For example in time=0 sec a=
1
20
15
4
in time 5 sec a=
10
11
2
13
So the maximun value of row(1) is 10 in time 5 seg The maximun value of row(2) is 20 in time 0 seg The maximun value of row(3) is 15 in time 0 seg The maximun value of row(4) is 13 in time 5 seg
Also, the time interval (I mean 0 to 10 sec), has to be introduced by user when the code asks for it.
Hope you can help me!
댓글 수: 0
답변 (1개)
Matt J
2013년 6월 23일
This will take the maximum across the rows of "data"
[maxval,maxloc]=max(data,[],2)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!