Maximun Value in Vectors

2 ビュー (過去 30 日間)
Virginia
Virginia 2013 年 6 月 23 日
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!

回答 (1 件)

Matt J
Matt J 2013 年 6 月 23 日
This will take the maximum across the rows of "data"
[maxval,maxloc]=max(data,[],2)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by