How to save a changed file?

조회 수: 7 (최근 30일)
ALI HADDACH
ALI HADDACH 2020년 8월 14일
댓글: Walter Roberson 2024년 12월 10일
I have a bot file (ascii file) with positive and negative values, so my purpose is to change the positive value to NaN (as i did it) and then save the file with the same extension, like change the value of the file, but i don't know how to save the file with the same extension . Here is my file and my code.
clear all
clc
filename='emodnet_format_Ali_new_one.bot';
deliminator = ' ';
bathy=dlmread(filename,deliminator,3,0); % read bathy-data
bathy(bathy>0)=NaN;
save('bathy.bot','-ascii');
I don't know if the final line is correct , or it may change.
  댓글 수: 1
Walter Roberson
Walter Roberson 2024년 12월 10일
testing...
dinfo = dir('em*');
filenames = {dinfo.name}
filenames = 1x1 cell array
{'emodnetbathyy.txt.html'}
dbtype(filenames{1})

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

답변 (1개)

Vidhi Agarwal
Vidhi Agarwal 2024년 12월 10일
To save the file you can try using "save" function of MATLAB. Refer to the following documentation to read more about it: https://www.mathworks.com/help/matlab/ref/save.html
Hope this helps!

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by