Text file row-column formatting

1 visualizzazione (ultimi 30 giorni)
Lalit Patil
Lalit Patil il 4 Dic 2012
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..?

Risposta accettata

Walter Roberson
Walter Roberson il 4 Dic 2012
Modificato: Walter Roberson il 4 Dic 2012
YourData = load('3d.txt');
YourData(YourData(:,3) == 0, :) = [];
save('New3d.txt', 'YourData', '-ascii');
  2 Commenti
Lalit Patil
Lalit Patil il 4 Dic 2012
It shows this kind of error.
??? Index of element to remove exceeds matrix dimensions.
Walter Roberson
Walter Roberson il 4 Dic 2012
Sorry I have edited the above to fix the problem.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Characters and Strings in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by