Excluding data points from a file
Show older comments
I have a data file full of lengths and areas of cube cluser at tifferent time. The format of the data file looks like:
t a r
0 1 .23
0 4 1
... ... ...
Though the points are relevant, I don't need them all. What I'd like is to have mat lab plot the points for whenever a > 4. But every time I try something, I run out of memory (note: there are 52500+ points in this data file, hence why I'm trying to get rid of unnecessary points). Is there a way that it can go through all the data, and plot when a is grater than 4 with the corresponding r? If I could allocate the memory, that'd be great but I have to do this for multiple files, and each file has a different total number of points, so I can't just fix a number to the memory matrix. The code looks like the following so far:
fia=(fopen('data.txt');
A = fscanf(fia, '%f %f %f', [3,inf]);
a1 = A(2,:);
r1 = A(3,:);
a=a1(a1>4);
hold all
plot(log(r),log(a));
Would a while function work, for I tried hat, but I still ran out of memory. Thank you.
Accepted Answer
More Answers (0)
Categories
Find more on Time Series Events 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!