Text file row-column formatting

1 回表示 (過去 30 日間)
Lalit Patil
Lalit Patil 2012 年 12 月 4 日
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 日
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 件)

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by