Clear Filters
Clear Filters

Maximun Value in Vectors

1 view (last 30 days)
Virginia
Virginia on 23 Jun 2013
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!

Answers (1)

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

Categories

Find more on Numeric Types in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!