Sorting data from text file

1 view (last 30 days)
Tyler McDonald
Tyler McDonald on 28 Oct 2014
We have to take data from a .txt file and create a for loop that searches through the data and then finds the lowest value. It then displays that value and searches for the next highest number.
What I have so far:
[Time Height] = textread('HW4_CurveFitData.txt','%f %f','delimiter',',');
t = [];
h = [];
CurrentValue = -inf;
while length(t) < length(Time)
for k = 1 : length(Time)
if Time(1) > CurrentValue
end
end
t(end+1)= CurrentValue
end
I'm getting caught up in the middle part where you have to search through the data.

Answers (0)

Categories

Find more on Environment and Settings in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!