Filter löschen
Filter löschen

How to edit and save xyz format data?

15 Ansichten (letzte 30 Tage)
Amra Rajuli
Amra Rajuli am 4 Apr. 2018
Kommentiert: Amra Rajuli am 4 Apr. 2018
Hello, I replace some value in z column (ex: -0,01 become 0) and plot it. But it seems not all data are replaced well. After that, how to save it to a new XYZ file, so I can make a comparison. The script that I use :
function tes_replace
A = load('no_river.txt');
A(A(:,3)==-0.01,3)=0;
x = A (:,1); y = A (:,2) ; z = A(:,3);
scatter (x,y,10,z,'filled')
colorbar
caxis ([-0.01 0])

Akzeptierte Antwort

KSSV
KSSV am 4 Apr. 2018
% function tes_replace
A = load('no_river.txt');
x = A (:,1); y = A (:,2) ; z = A(:,3);
% z(z==-0.01)=0;
idx = abs(z-(-0.01))<10^-3 ;
z(idx) = 0 ;
scatter (x,y,10,z,'filled')
colorbar
caxis ([-0.01 0])
  3 Kommentare
KSSV
KSSV am 4 Apr. 2018
newdata = [x y z] ;
save('myfile.txt','newdata','-ascii')
Amra Rajuli
Amra Rajuli am 4 Apr. 2018
thank you

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Graphics Object Identification finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by