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..?

 採用された回答

Walter Roberson
Walter Roberson 2012 年 12 月 4 日
編集済み: Walter Roberson 2012 年 12 月 4 日

0 投票

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

2 件のコメント

Lalit Patil
Lalit Patil 2012 年 12 月 4 日
It shows this kind of error.
??? Index of element to remove exceeds matrix dimensions.
Walter Roberson
Walter Roberson 2012 年 12 月 4 日
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