How to save a changed file?

7 visualizaciones (últimos 30 días)
ALI HADDACH
ALI HADDACH el 14 de Ag. de 2020
Comentada: Walter Roberson el 10 de Dic. de 2024
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 comentario
Walter Roberson
Walter Roberson el 10 de Dic. de 2024
testing...
dinfo = dir('em*');
filenames = {dinfo.name}
filenames = 1x1 cell array
{'emodnetbathyy.txt.html'}
dbtype(filenames{1})

Iniciar sesión para comentar.

Respuestas (1)

Vidhi Agarwal
Vidhi Agarwal el 10 de Dic. de 2024
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!

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by