Text file row-column formatting

I have this text file, It contains 3 columns. I want to remove all those rows whose third column element is 0...
So, how to do it..?

 采纳的回答

YourData = load('3d.txt');
YourData(YourData(:,3) == 0, :) = [];
save('New3d.txt', 'YourData', '-ascii');

2 个评论

It shows this kind of error.
??? Index of element to remove exceeds matrix dimensions.
Sorry I have edited the above to fix the problem.

请先登录,再进行评论。

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by