MATLAB: Text file row-column formatting

formattingrow columntext file

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

Best Answer

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