Maximun Value in Vectors

2 vues (au cours des 30 derniers jours)
Virginia
Virginia le 23 Juin 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!

Réponses (1)

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

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by