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])

 채택된 답변

KSSV
KSSV 2018년 4월 4일

0 개 추천

% 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

Amra Rajuli
Amra Rajuli 2018년 4월 4일
thank you. it works. one more question, how to save it to a new file? sorry, maybe it is an odd question, but I am stuck, thank you.
newdata = [x y z] ;
save('myfile.txt','newdata','-ascii')
Amra Rajuli
Amra Rajuli 2018년 4월 4일
thank you

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Annotations에 대해 자세히 알아보기

태그

질문:

2018년 4월 4일

댓글:

2018년 4월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by