Excluding data points from a file
古いコメントを表示
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.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で 2-D and 3-D Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!