Finding max, min or avg value of a section of vector
33 views (last 30 days)
Show older comments
I have a vector of size 35116x1. I want to find max, min or avg of only a section of the vector like only using the first 2926 elements. I tried using index but it doesn't work. Am I doing anything wrong here or is there any other way of doing it?
for i=1:2926
max(num2(i,1)) %num2 is the vector
end
2 Comments
Claudio Stucki
on 5 Feb 2017
if your vector num2 includes the first 2926 elements:
max(num2);
min(num2);
mean(num2);
Otherwise use you can use:
max(yourVector(1:2926))
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Matrix Indexing 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!